Create your own Social Sharing Button Links

More
8 years 5 months ago - 8 years 5 months ago #63231 by iamrobert
I wanted to create my own simple sharing buttons - so I can share the URL via FB/Twitter or Linked In. Addthis was a bit heavy for this site's requirements - and didn't see any tutorial anywhere for Joomla.

This code can be used in either FLEXIcontent item template or your own Joomla Template
Code:
<?php //GET CURRENT PAGE URL - need to urlencode; $social_link = urlencode(JURI::current()); //GET CURRENT PAGE TITLE - need to rawurlencode; $doc = JFactory::getDocument(); $page_title = rawurlencode($doc->getTitle()); //GET META DESCRIPTION - need to rawurlencode; $meta_description = rawurlencode($doc->getMetaData("description")); ?> //CODE CAN BE PLACED IN YOUR TEMPLATE <ul class="share-buttons"> <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $social_link;?>&amp;t=<?php echo $page_title;?>" title="Share on Facebook" target="_blank">FB</a></li> <li><a href="https://twitter.com/intent/tweet?source=<?php echo $social_link;?>&amp;text=<?php echo $page_title;?>:%20<?php echo $social_link;?>" target="_blank" title="Tweet">TWITTER</a></li> <li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?php echo $social_link;?>&amp;title=<?php echo $page_title;?>&amp;summary=<?php echo $meta_description;?>&amp;source=<?php echo $social_link;?>" target="_blank" title="Share on LinkedIn">LINKEDIN</a></li> </ul>

You can look here for further code:
simplesharingbuttons.com/
Last edit: 8 years 5 months ago by iamrobert.

Please Log in or Create an account to join the conversation.

More
8 years 5 months ago #63310 by bunnachart
You can use module joomla for insert php code like flexi-custom-code
and then create field fc load module hide from both (Front and Back-end) and load that module and go to template drag field to template and save

Please Log in or Create an account to join the conversation.

More
8 years 5 months ago #63328 by micker
thanks for share

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.299 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline