Social Bookmarking
Linking to popular Social Bookmarking websites
This building block allows you to put links to some popular Social Bookmarking websites on your page.
How it works
By applying a metadata schema to a page, you get the abillity to define to which social bookmarking websites you want to link.

Figure 1 - Metadata schema
The list of bookmarking websites from which you can choose is a predefined list. Later on will be explained how to change this list.
Besides applying the bookmarking metadata schema to a page, it can also be applied to a structure group. This will cause all pages in that structure group to use the same bookmarking links.
When publishing a page, the icons of and links to the social bookmarking websites are placed on the page.

Figure 2 - The icons
When the visitor clicks on one of the icons, the corresponding website is opened and the title and URL of your page will be already filled in.

Figure 3 - Del.icio.us
Installation instructions
After you've downloaded the zip file and unpacked it on the content management server, we can get started installing the building block.
Creating the metadata schema
In order to define on the page or on the structure group which bookmark links we want to display, we have to create a metadata schema. Call it 'Social Bookmarks' or something like that.
On the 'Metadata Design' tab add one field and make sure that the XML Name is 'bookmarks'. The field type should be 'Text' and checkbox 'Values will be selected from a list' should be ticked.
Now add the next list values:
- Del.icio.us
- Digg
- Facebook
- Furl!
- Ma.gnolia
- Mixx
- Newsvine
- Reddit
- Stumble Upon
- Twitter
- Yahoo! Buzz
Don't make any typos because those values will be used in the building block when publishing the page.
Select 'Check boxes' as the List type and enter '1' for the boxes per line.
When you're done, your schema should look like this:

Figure 4 - Creating the metadata schema
If this is too much work, you can also do it this way:
- Create a new metadata schema and call it 'Social Bookmarks'
- Go to the 'Source' tab, select everything from "<xsd:annotation>" to "</xsd:import>" and delete it (see figure 5)
- Open file "Social Bookmarks - Schema.txt" in folder "Cms" in the unzipped folder.
- Copy everything from the file to the metadata schema
- Save and close the schema

Figure 5 - Delete everything from "<xsd:annotation>" to "</xsd:import>".....
Okay, we've created the metadata schema. On to the next step.
Uploading the assembly
The purpose of this step is to create two Template Building Blocks:
- RenderSocialBookmarks
The C# TBB that can be used in a Component or Page Template
- SocialBookmarks
The TBB containing the .NET Assembly
To create those two TBB's we're going to use the TCMUploadAssembly tool. This tool can be found somewhere in the Tridion folders on the content manager, but it is also included in this building block package.
The syntax of the TCMUploadAssembly tool is:
TcmUploadassembly.exe <path to the assembly> /targeturl:<URL of the CME> /folder:<TCM URI of the target folder>
Suppose you've unzipped this building block to folder "C:\Temp" then the call to TcmUploadAssembly should be something like
C:\Temp\SocialBookmarking\Src\SocialBookmarks\Tools\TcmUploadAssembly.exe C:\Temp\SocialBookmarking\Bin\SocialBookmarks.dll /targeturl:http://r53.tridion.com/ /folder:tcm:27-112-2
where "http://r53.tridion.com/" is the URL of the Tridion Content Manager and "tcm:27-112-2" is the URI of the Tridion folder in which the building blocks will be created.
After you ran the tool you should find the two building blocks in the defined folder.
Adding the RenderSocialBookmarks building block to a compound template
Now the TBB's are present in Tridion you can start using them.
In the Template Builder, open the Page or Component Template on which you want the bookmarking links to be displayed.
In the Building Blocks panel, under "Compound", you should see the RenderSocialBookmarks building block.
Drag it to the middle panel and put it before the Dreamweaver layout template.
Save and close the template.

Figure 6 - Adding RenderSocialBookmarks to a template
Adding a line to your layout Dreamweaver TBB
The last thing you have to do is adding a line to your Page or Component layout Dreamweaver TBB.
On the place where you want the bookmarking icons to be displayed, add the next line:
${SocialBookmarks}
Start creating pages
That's it! Now you can create a page, add the metadata schema to the page, select the bookmarking websites you want to have displayed and publish the page. The result could be something like this.

Adding your own links to the predefined Social Bookmarking links
If you want to add you own links to Social Bookmarking websites to the ones already being rendered, you have to do the following:
- Add a list value to the metadata schema
- Open the SocialBookmarks Solution included in the zip file in Visual Studio 2005.
- Go to the RenderSocialBookmarks.cs Class. In there you'll find a switch statement with a case statement for each list value
- For the value you've entered in the metadata schema, add a case to the switch statement
- Build the solution
- Upload the assembly
Tags
:

social bookmarking,

web 2.0