Add a LinkedIn Button to your Textpattern CMS Articles

admin-ajax

In this final article in my series of social sharing, I’m going to explain how to add a LinkedIn button to your Textpattern CMS articles. For disclosure, I don’t use LinkedIn – and don’t intend to – but I’m happy to share the technique for adding support to your website if it’s something that you want to do, ‘cos I’m a swell kinda guy. Per the previous 4 articles for Facebook, Twitter, Tumblr and Google plus, there’s code editing to be done. Before you even entertain the idea of changing your site, make sure you have good backups. If you’re edgy and brave, you can choose to continue without backups at your own risk. This is a low-risk text edit, so the chances of something breaking are slight, but seriously – make backups.

OK, pep talk over with. Take a look at what your site is going to be like after a LinkedIn button is adorning your sidebar:

Google ChromeScreenSnapz002

To get this natty button, you need to edit the archive page of your Hive theme. Log in to Textpattern and locate the archive page from the Presentation → Pages tab. Copy and paste it into your text editor and look for the <div role=”complementary”> tag to point out the start of the grey sidebar panel. The code for a LinkedIn button is:

<script type="IN/Share" data-url="<txp:permlink />" data-counter="right"></script>

You can dress this up a little if you wish. I chose to tack it onto an <h4> header to tell my visitors about how they can (should) share all my cool things (take the hint, readers) to their buddies. Here’s how I did it:

<p>
 <txp:feed_link class="feed-rss" label="RSS" />
 /
 <txp:feed_link class="feed-atom" flavor="atom" label="Atom" />
 </p>
<div>
 <h4>Share</h4>
 <script type="IN/Share" data-url="<txp:permlink />" data-counter="right"></script>
 </div>

You may spot that there’s no reference to LinkedIn JavaScript in that code, and you’d be right. The guts of the code lives toward the bottom of the page before the </body> tag. This is the code that you need to insert:

<script src="//platform.linkedin.com/in.js" type="text/javascript">
 lang: en_US
 </script>

Well, that was easy. That loads the LinkedIn JavaScript to your site.

Thanks for reading my short series of social sharing solutions for super solid and stupendous sites. I’ve over-alliterated myself now, I must go lay down. See you again soon.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting and use coupon TEXTPATTERN for 20% off your first invoice!

Tags: , , , , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *


5 + 4 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>