Here’s some code that produces tag links to four popular tag destinations, your blog, blogs.sun.com, technorati and del.icio.us (for your Roller Weblogger based blog, as the code is velocity).
It also ensures that the links are marked as tags, so that crawlers that look for and index tags and tag data will pick them up (microformat and semantic web focused applications, like the ‘Operator’ plug in for Firefox also pick them up of course).
I only add it to individual entries, rather than collections, which is what “#if ($model.permalink)” checks for.
Best to add just before or just after the Comments section in your main Roller template.
The code also includes some functionality to replace ‘-‘ and ‘+’ with ‘ ‘, so as to make the text fit in the table (this does not affect the tag).
You can see this functionality here, on my blog, and on Bill Vass’ blog, however you will need to look at an individual blog post to see it.
If your on bsc you’ll need to replace ‘eclectic’ with your bsc blog name, or if your not on bsc you’ll need to replace “http://blogs.sun.com/eclectic/” with your entire blog URL.
Here’s the code:
#if ($model.permalink)
Tags
This blog
Sun Blogs
Technorati
Del.icio.us
#set ($mytags = $entry.tags) #foreach ( $tag in $mytags ) #set ($tagText = $tag.name) #set ($tagTextNew = "") #if ($tagText.length() > 0) #set ($toDo = $tagText.length() - 1) #set ($number = 0) #foreach ($number in [0..$toDo]) #if (($tagText.charAt($number) == "-") || ($tagText.charAt($number) == "+")) #set ($tagTextNew = $tagTextNew + " ") #else #set ($tagTextNew = $tagTextNew + $tagText.charAt($number)) #end #end #end
$tagTextNew
$tagTextNew
$tagTextNew
$tagTextNew
#end
#end
- Recovered link: https://horkan.com/2008/08/11/roller-weblogger-tag-technorati-delicious
- Archived link: https://web.archive.org/web/20100715131719/http://blogs.sun.com/eclectic/entry/roller_weblogger_tag_technorati_delicious
- Original link:
http://blogs.sun.com/eclectic/entry/roller_weblogger_tag_technorati_delicious