Jump to:

3443 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » print url in fb share button

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 312 Views
  • thomas.paulson
    Community Member
    72 Posts

    print url in fb share button Link to this post

    I have a product listing page based on product type like the below.

    -url-/products/type/Tyre Changer/?category=2

    I want to share the above link to FB, I tried print url using {$AbsoluteLink}, but print only -url-/products/.

    <div id="fb-root"></div>
    <script>(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>

    <div class="fb-share-button" data-href="{$AbsoluteLink}" data-type="button_count"></div>

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.