1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AddThis - Carrying over thread title information?

Discussion in 'Styling and Customization Questions' started by maxwolfie, Aug 19, 2012.

  1. maxwolfie

    maxwolfie Active Member

    Hi All,

    I have XenPorta installed and I want to have the AddThis sharing buttons on RecentNews posts. The AddThis buttons work however they do not carry over the thread/news title when clicked.

    <div class="shareControl" style="width:107px">
    <div class="addthis_toolbox addthis_default_style ">
        <a class="addthis_counter addthis_pill_style" addthis:url="{xen:link canonical:threads, $news}" {xen:if {$thread.title}, 'addthis:title="{xen:helper threadPrefix, $thread, escaped}{$thread.title}"'}></a>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4fbae4826478f92e"></script>

    www.HackSlashRepeat.com - Look for the orange buttons along the RecentNews entries on the home page.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't use addthis myself, but in looking at XenForo's usage it appears to require a URL.

    Code example:

    Admin CP -> Appearance -> Templates -> post_permalink

    					<xen:include template="addthis_ajax">
    						<xen:set var="$url">{xen:link full:threads/post-permalink, $thread, 'post={$post}'}</xen:set>
    Then in the addthis_ajax template you can see how the url is used:

    var addthis_share = {
    	url: "{xen:jsescape $url}",
    	templates: {
    		twitter: "{{title}} {{url}}{xen:if {$xenOptions.tweet.via}, ' via @{$xenOptions.tweet.via}'}"
    Hopefully that helps.
  3. maxwolfie

    maxwolfie Active Member

    Hi Jake,

    Sorry for the long delay, I have been traveling a lot lately. I have had a look at the code but it's a bit advanced for me to figure out the "next step". Is there some line of code that I should be modifying or adding etc to one of the templates?

    I appreciate your help.



Share This Page