Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • roojai Friend
    #190146

    I want the user that has clicked the shared article within facebook to land in the article within the structure of my website. Currently they land with ?tmpl=component at the end of the URL which means they cannot see the menu etc.

    This is from the JA Wall K2 template with the pop up function.

    I have added some custom social links but the native K2 links have the same effect.

    Any tips to remove the ?tmpl=component from the URL from the social link buttons in articles (items) appreciated.

    Website here:

    http://www.tritonstriathlon.com/

    Many thanks 🙂

    phong nam Friend
    #504041

    Hi roojai,

    You can backup your files and try to follow this tip to solve your issue at http://www.joomlart.com/forums/topic/social-bookmark-url-issue-with-tmplcomponent-added-to-the-back-link/

    roojai Friend
    #504095

    Thanks for the help.
    There are a few solutions mentioned in that thread, do you mean this code:

    <script type=”text/javascript”>
    (function(d){
    var js, id = ‘facebook-jssdk’, ref = d.getElementsByTagName(‘script’)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(‘script’); js.id = id; js.async = true;
    js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”;
    ref.parentNode.insertBefore(js, ref);
    }(document));
    </script>

    <!– Place this tag after the last +1 button tag. –>
    <script type=”text/javascript”>
    (function(d) {
    var js, id = ‘gplus-jssdk’, ref = document.getElementsByTagName(‘script’)[0];
    if (d.getElementById(id)) {return;}
    js = document.createElement(‘script’); js.id = id; js.type = ‘text/javascript’; js.async = true;
    js.src = ‘https://apis.google.com/js/plusone.js’;
    ref.parentNode.insertBefore(js, ref);
    })(document);
    </script>

    <?php
    $fulllink = JURI::getInstance()->toString(array(‘scheme’, ‘host’, ‘port’)) . $this->item->readmore_link;
    $sociallink = new JURI($fulllink);
    $sociallink->delVar(‘tmpl’);
    ?>
    <div class=”fb-like” data-href=”<?php echo $sociallink; ?>” data-send=”false” data-layout=”button_count” data-width=”150″ data-show-faces=”false”></div>
    <div class=”g-plusone” data-annotation=”inline” data-width=”300″ data-href=”<?php echo $sociallink; ?>”></div>

    <div class=”fb-comments” data-href=”<?php echo $sociallink; ?>” data-num-posts=”2″ data-width=”576″></div>

    roojai Friend
    #504096

    That doesn’t seem to work. I am now trying this – but it is unclear on how to do the FB button:

    data-url=”<?php echo substr(JURI::root(),0,-1).str_replace(JURI::root(true),”,$this->item->link); ?>”

    roojai Friend
    #504101

    That did not work. Instead I did this (this is for K2 item like button only):

    <!– this is standard facebook button code –>
    <div class=”itemFacebookButton” style=”min-height:180px;”>
    <div id=”fb-root”></div>
    <script type=”text/javascript”>
    (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = “//connect.facebook.net/en_US/all.js#xfbml=1″;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));
    </script>
    <!– this is the only bit that has been changed–>
    <div class=”fb-like” data-send=”false” data-width=”200″ data-href=”http://www.your.ulr..com<?php echo $this->item->link ?>” data-show-faces=”true”></div>
    </div>

    It works fine – facebook links back to the article in the item view

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 2 voices, and was last updated by  roojai 11 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum