Enabling Social API for every page

Joomla template for easily build sports magazine website with advanced content display features and clean, unique design.
GK User
Wed May 22, 2013 2:05 pm
Hi guys,

How to enable Social API (fb like, fb share, twitter share etc.) for every page on my website (as module), not just for articles, so when someone click share to share URL on which user is at the moment?

Appreciate any help.
User avatar
Senior Boarder

GK User
Wed May 22, 2013 2:53 pm
Sadly, it cant be done "easy way".
Social API is attached only to single articles in file: /templates/gk_sporter/html/com_content/article/default.php
around line 254:
Code: Select all
   <gavern:social><div id="gkSocialAPI"></gavern:social>
          <gavern:social><fb:like href="<?php echo $cur_url; ?>" GK_FB_LIKE_SETTINGS></fb:like></gavern:social>
        <gavern:social><g:plusone GK_GOOGLE_PLUS_SETTINGS callback="<?php echo $cur_url; ?>"></g:plusone></gavern:social>
        <gavern:social><g:plus action="share" GK_GOOGLE_PLUS_SHARE_SETTINGS href="<?php echo $cur_url; ?>"></g:plus></gavern:social>
          <gavern:social><a href="http://twitter.com/share" class="twitter-share-button" data-text="<?php echo $this->item->title; ?>" data-url="<?php $cur_url; ?>" gk_tweet_btn_settings>Tweet</a></gavern:social>
          <gavern:social><a class="DiggThisButton GK_DIGG_SETTINGS" href="<?php echo $cur_url; ?>"></a></gavern:social>
          <gavern:social><a href="http://www.delicious.com/save" onclick="window.open('http://www.delicious.com/save?v=5&noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;" class="deliciousBtn" title="<?php echo JText::_('TPL_GK_LANG_DELICIOUS_TITLE'); ?>"></a></gavern:social>
          <gavern:social><a href="http://www.instapaper.com/hello2?url=<?php echo urlencode($cur_url); ?>&amp;title=<?php echo urlencode($this->item->title); ?>" class="instapaperBtn" title="<?php echo JText::_('TPL_GK_LANG_INSTAPAPER_TITLE'); ?>"></a></gavern:social>
           <gavern:social><a href="http://pinterest.com/pin/create/button/?url=<?php echo $cur_url; ?>&amp;media=<?php echo $pin_image; ?>&amp;description=<?php echo str_replace(" ", "%20", $this->item->title); ?>" class="pin-it-button" count-layout="GK_PINTEREST_SETTINGS"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="<?php echo JText::_('TPL_GK_LANG_PINIT_TITLE'); ?>" /></a></gavern:social>
     <gavern:social><div class="clr"></div></div></gavern:social>


If You would like to have it in other places, You should start by copying this block code to other functional template files, edit css so it looks ok also in other places, but finally this kind of changes just might not work at all.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.