We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    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]]">
      • 46220
      • 66 Posts
      I would not know about a solution on post level. On thread level I use share this to post on FB and/ or Twitter. It has been very helpful to me, but as said, it is not on post level.
        • 46886
        • 1,154 Posts
        Hey would you post your solution here? It would be helpful.

        Yeah at post view there are issues for sure, its hard to grab the right data. Facebook is a pain because they want the meta data stuff, which is fine if you have just pages of contents but much harder with other configurations.

        I probably should go back into this and clean it up more, but its not high on my to-do list haha.
          • 46220
          • 66 Posts
          It actually is quite easy. Just go to http://www.sharethis.com and pick "Website" as your platform, select a style and customize it to your likings. Click on get code and register there (you have to do that in order to receive the code). Place the code in your <head>. If I am not mistaken, that's it. Let me know if you run into any problems.
            • 46886
            • 1,154 Posts
            Yeah I looked into that, but it didn't work in the post view.

            Also I think you had to put the button in there too, it won't just show up somewhere.
              • 9995
              • 1,613 Posts
              I haven't read the wole threat so dunno if this is usefull but you can clear Facebooks page cache: https://developers.facebook.com/tools/debug/og/object/

              I couldn't understand why it didn't refresh and found out you have to fetch again..


                Evolution user, I like the back-end speed and simplicity smiley