so I'm trying to make it possible for a user to share a uniquely generated page. This page pulls variables from the Django database, puts it into python variables, and posts it to the webpage. I want the user to be able to share this page, with the variables. However, it seems that if the variable is generated on that webpage, Facebook can't "see" it. I assume this has something to do with the scope of the variables I use. Here is what I have:
<a id="custom-share" onclick="FB.ui({method: 'feed', link:
'http://www.url.com/', caption: '{{message}}'}, function(response)
{});">Share this on Facebook</a>
Which will pull up a share dialogue with the caption {{message}}. What I've tried:
I tried using {% load set_var %} with {% set message = e.text %} where e.text is the variable being pulled from the database. For some reason when I try to share {{message}}, it pops up blanks. When I try to insert {{message}} elsewhere on the page, it works though.
I then tried to see if a variable, passed through views.py would work. This works, but is not the variable I want to be passed to the FB share.
So here I am, I tried to different python variables, and one works and one doesn't. Any ideas on how I can get to change the description dynamically?