Dr. Jackie Black wanted to add some functionality to her blog to connect it to social networking sites so I installed the social bookmarking plugin via spartacus and selected a few of the ones we opted to link to...
35 seconds and done!
Next she wanted to add a few more with larger icons to link to Twitter with a Tweet This link, stumble upon with a stumble this icon and a couple others.
These were not included in the Serendipity plugin - so they cant just be enabled like the others.
Now for a brief moment I thought to myself - maybe wordpress has gotten better because I know for a fact that there are already plugins for everything.
But then I snapped out of it and remembered WHY I love Serendipity blogs - A little bit of smart goes a long way!
I just had to modify the existing plugin's code and paste it into the template for the entries and BAM - Social networking glory reached WITHOUT a plugin!
Tweet THAT wordpress!
The rest of this is the techy details...
This was easily overcome by using the following recipe snagged from the social networking plugin:
Serendipty uses the following snippets to create links for passing to social networks:
{$entrydata.url|escape:url}&title={$entrydata.title|escape:url}
This can be found in the social bookmark plugin, for example:
<a href="http://del.icio.us/post?url={$entrydata.url|escape:url}&title={$entrydata.title|escape:url}" title="Bookmark {$entrydata.title|escape} at del.icio.us"><img width="18" height="18" src="{$entrydata.path}delicious.png" class="socialbkmark" alt="Bookmark {$entrydata.title|escape} at del.icio.us"/></a>
That's the code that adds the del.icio.ous icon and the generated link
I wanted to feature a few others as "primary" social networking sites so I added the following to my entries.tpl
<a href="http://twitter.com/home?status={$entrydata.url|escape:url}&title={$entrydata.title|escape:url}" title="Tweet This {$entrydata.title|escape} "><img src="/images/twitter-square-icon.png" alt="Tweet This {$entrydata.title|escape} "/></a>
<a href="http://www.facebook.com/share.php?u={$entrydata.url|escape:url}&title={$entrydata.title|escape:url}" title="Share This {$entrydata.title|escape} "><img src="/images/facebook-square-icon.png" alt="Share This {$entrydata.title|escape} "/></a>
<a href="http://www.linkedin.com/shareArticle?mini=true&url={$entrydata.url|escape:url}&title={$entrydata.title|escape:url}" title="Link This {$entrydata.title|escape} "><img src="images/linkedin.jpg" alt="Tweet This {$entrydata.title|escape} "/></a>
You don't need anything special like an API or a key - just a url and an image to load for the link!