Do you run a site where you can benefit from tons of potential traffic from social bookmarking sites? You can easily add a ColdFusion custom tag containing all the linked icons to allow your visitors to submit your pages to sites like Digg, del.icio.us, Reddit, and others.
A client asked me to create social bookmarking links at the bottom of her posts in her ColdFusion blog. I found a blog that posted the code for over 100 social bookmarks for blog footers. I grabbed the code from 12 of the most popular sites and also copied the icons to my local machine. The code to post to a social bookmarking site is not very complicated, but they do vary. An example of a Digg icon’s code is as follows:
<a href="http://digg.com/submit?phase=2& url=YOURPAGEURL&title=PAGETITLE">Digg This</a>
The code is pretty self-explanatory, but generally, the words in the page title need to be delimited with a plus sign (+).
Here’s what we are going to do. We are going to take code from all of these social sites, put them all on one tag and call that custom tag from one spot on our site. This allows us to add or remove social links with having to change the code in every stance on the our site. Our end result is going to look like the following:

First, open a blank page and let’s wrap the every thing in an <cfif> statement to prevent the icons from display if a page title and url are not present. Within that, we want to place a <cfoutput> tag to process our variables.
<cfif IsDefined('ATTRIBUTES.Title') AND IsDefined('ATTRIBUTES.URL')>
<cfoutput>
</cfoutput>
</cfif>
Then we want to add a table or a tableless CSS-layout to display the links and icons. Place this code between the <cfoutput> tags. We’ll use a table for example.
<table cellpadding="2" cellspacing="2" width="400">
<tr>
<td nowrap="nowrap">
<b>Share this:</b>
</td>
<td> </td>
</tr>
</table>
Now we want to replace the with our first social bookmarking link and icon. Here is the code for posting a link to Ask.com.
<a href="http://myjeeves.ask.com/mysearch/QuickWebSave?v=1.2& t=webpages&title=#replace(ATTRIBUTES.Title, " ","+", "ALL")#&url=#ATTRIBUTES.URL#"><img src="http://WWW.YOURSITE.COM/ SiteImages/AskJeeves.png" alt="Save this page in Ask.com" width="16" height="16" border="0"/></a>
Just paste the footer code and replace the title and URL with the ATTRIBUTES variable that is needed in custom tags. Paste in as many sites you would like to have your visitors link to. There are over 100 on that blog post. I added the replace() to substitute the spaces for plus signs. Also, Make sure to have all the icons stored in your own image folder. I have provide copies of the 12 that I used for this tag.
Save the file to your custom tag folder, and use the following to call the tag from anywhere you need it.
<cf_socialbookmarks title="#PAGETITLE#" url="#URL#">
I hope this tutorial has given you a push in the right direction for socializing your content. I have provided a .zip file that contains the images as well as the completed tag.

