Hi I am working on getting the shares working in Discuss. I am targeting the post view, as usual, so they will be available on every post, thread starter or reply. I am not sure now how I would go about targeting only thread starters, it might need a little php script to check the db, not sure though.
Anyway in post view I am getting some love from code like this for most sites:
<a target="_blank" href="
https://twitter.com/intent/tweet?text=[[+content_raw:ellipsis=`80`]]&url=[[+url]]&via="rayxilawforums"><img src="path/twitter.png" style="style" />
The via doesn't seem to be working, but its fine for my needs.
However the bigger problem is facebook, which wants me to use metatags but they don't seem to work. Well, it works, the title and link goes in, but the description doesn't at all. In the wrapper code, [[!+discuss.title]] seems to successfully get the title, but I have tried all sorts of combos of discuss.content discuss.message and so on with little luck as to the contents of the post being shared. In fact it wants to grab the 'Don't be that guy" content!
For now, I am just going with double title. Its imperfect but less imperfect than the alternatives.
Here is what I have in the wrapper.tpl file, in the header:
<title>[[!+discuss.pagetitle]] | Rayxi Law Forums</title>
<meta name="title" content="[[!+discuss.pagetitle]]">
And the first one is working as the output in facebook includes the pipe and the site name.
Then I have:
<meta property="og:image" content="[[!++site_url]]assets/templates/images/rlf.png" />
<meta property="og:description" content="[[!+discuss.pagetitle]]" />
The picture sort of works, the checker tells me they can find it successfully but so far in my testing a facebook pic appears instead. I might host that front a facebook account to make them happy.
But the og:description is just not working for me now. The facebook share itself is simple because apparently you are not allowed to put info in there, so I just have
<img src="assets/
http://www.facebook.com/sharer/sharer.php?u=[[+url]]">