Section 42. Using Blogrolls

42. Using Blogrolls


29 Understanding the Blogger Template Structure and Editor

32 Understanding the Blogger Template Language

A blogroll is nothing more than a list of blogs (or other websites) you read frequently; it is typically listed in the sidebar of your blog. By listing links to those sites, you associate yourself with the content produced by other bloggers, thereby helping your readers formulate a better picture of who you are. For instance, my personal blogroll currently lists approximately 100 blogs I read on a regular basis. These blogs run the gamut from "life blogs" to "academic" blogs to "geeky" blogs and everything in between, showing that I have a wide range of interests.

One hundred links is a lot of links to maintain statically; that is, by placing the HTML code for these links directly into my Blogger template. Because I find new blogs to add to my blogroll on an almost daily basis, that would be a lot of template editing and republishing. This is where blogroll services enter into the mix. A blogroll service provides an interface for you to store the names and URLs of blogs or other websites you read, allows you to customize the appearance of these links in some way, and also provides you with a bit of JavaScript to include in your Blogger template that will result in your blogroll being published on your blog.

42. Using Blogrolls


Blogroll services typically output your blogroll in several different formats. Some of those formats require additional server-side programming that is not available to you as a Blogger user since you do not have access to the underlying server that creates the static pages making up your blog. Therefore, this topic focuses on the client-side inclusion of content in your blog.

The following example of maintaining a blogroll and implementing it on your blog uses the services of However, there are other blogroll services that allow you to save a list of links and publish it to your site with various degrees of customization. The interfaces for these sites vary in their ease of use and the latency between the content request and display.

For example, is another blogrolling service, backed by Yahoo! and found at This free service offers a unique method for finding new blogs and adding them to your blogroll in addition to the standard client-side inclusion via JavaScript. However, the current methods of customization for blogrolls are lacking for users without knowledge of XML formatting and the ability to produce their own server-side scripts.


The Bloglines World Wide Webbased RSS reader, which you'll learn about in 50 Using an RSS Aggregator, also provides tools to export your list of feed subscriptions as a blogroll for inclusion in your Blogger template.

To get started with the service, go to and register for a free account. After registering or logging in to the service, click the Home link in the navigation area. You will see your personal control panel, containing numerous items to assist you in maintaining your blogroll. Click the Add Links link in your control panel to begin adding links to your blogroll. You must know the title and URL of the website or blog that you want to add to your blogroll.

In addition to adding links, you can follow the Preferences link to customize certain aspects of your blogroll. For instance, one of my favorite aspects of the service is the ability to add an indicator next to the name of any blog that has been updated within a certain timeframe. As you can see in step 3, my personal blogroll has the [!!] characters appended to the end of the names of recently updated blogs. Other users append asterisks (*) or the word fresh!, and so onthe indicator you use is your choice, as is the "freshness" timeframe.

The next steps assume that you have registered with, added links to your blogroll, and are ready to include these links on your blog. Log in to if you are not already, click the Home link, and click the Get Code link in your control panel.


Obtain the JavaScript Code for Your Blogroll

The code generator provides you with several types of code snippets for obtaining your blogroll links. Blogger users should stick with the client-side method of inclusion, which is to use the JavaScript code. The additional methods for using your blogroll data require the ability to parse formats on the server side, which is not something Blogger users have access to. No fear, however: The JavaScript inclusion works wonderfully.


Place the JavaScript Code in Your Blogger Template


Before making modifications to your template, be sure to save a backup copy of your current template. If something goes awry while making changes to the template, you can quickly replace the messed-up version with the backup version.

After obtaining your JavaScript code, log in to Blogger and click the Change Settings icon in the Blogs section of the Blogger Dash board. Click the Template tab to access the Blogger template editor.

Determine where in your sidebar you would like your blogroll to appear, scroll through your template until you find a space for that placement, and paste the JavaScript code there. This placement should not be in the HEAD portion of your template; rather, it should be somewhere within the BODY element. In this example, I placed my blogroll after several other sections of links, including links to my Blogger archives. If you look at the top of the template editor textarea, you will see this code is within a <MainPage> </MainPage> conditional tag, meaning that my blogroll is displayed on only the main page of my blog. Using Blogger's conditional template tags, you can choose to display your blogroll on your main page, archive page, individual post pages, or some combination thereof. After making changes to your template, click the Save Template Changes button and republish your entire blog.


View Your Blogroll

After republishing your blog, view your blog to ensure that the blogroll is in its proper place. You might have to force-reload the page to obtain an uncached page before you can see the blogroll. Any blog updated within the timeframe specified in your preferences should have your chosen indicator appended to its name.

Blogging in a Snap
Blogging in a Snap (Sams Teach Yourself)
ISBN: 0672328437
EAN: 2147483647
Year: 2003
Pages: 124 © 2008-2017.
If you may any questions please contact us: