rss

Thursday, July 16, 2009

Change the “Subscribe to posts/comments” link in your Blogger template

In most Blogger templates, you will see a link beneath the main posts section which says “Subscribe to posts (Atom)” or “Subscribe to post comments (Atom)”, depending on the type of page you are viewing.

This basic link is intended to encourage visitors to subscribe to one of your blog’s feeds after reading your blog posts. However, with a little manipulation we can make this link become a much more useful and valuable tool for encouraging subscribers (or even remove this altogether!).

In this post, I’ll explain exactly how the “Subscribe to…” link works in Blogger templates, and offer some suggestions for how it may be improved.

Explaining the “Feed-links” includable

The “Subscribe to posts/comments” link which appears in your Blogger template is a part of the main Posts widget and is formed using a b:includable section of code.

In Blogger templates, “includables” are snippets of code which perform a certain function when live blog pages are displayed. They are similar to PHP includes, which many of you may be familiar with if you have dabbled with Wordpress templates before, though rather than be included on a separate server, Blogger includables are contained within a single blog template.

The includable section which is used to display feed links beneath your blog posts uses the following code by default:


<b:includable id=’feedLinksBody’ var=’links’>

<div class=’feed-links’>

<data:feedLinksMsg/>

<b:loop values=’data:links’ var=’f'>

<a class=’feed-link’ expr:href=’data:f.url’ expr:type=’data:f.mimeType’ target=’_blank’><data:f.name/> (<data:f.feedType/>)</a>

</b:loop>

</div>

</b:includable>


To make the contents of this “includable” appear at the appropriate place in the Blogger template, this line is used:


<b:include data=’feedLinks’ name=’feedLinksBody’/>


By default, this will appear just beneath the main posts section, and below the comments/backlinks sections on item pages.

When viewing your blog pages, the feed-links appear like this on non-item pages:

And like this on individual post pages:

As you can see in these different screenshots, the general “posts” feed is used on non-item pages, while the feed for an individual post’s comments is linked to on item pages. These links are generated automatically by a code tag in the includable section for the feed-links.

Altering the appearance and wording of feed-links in your Blogger template

As the “includable” for Blogger’s feed links is comprised of numerous tags, we can easily alter these to suit our preferences.

In order to edit your blog’s “feed-links”, you should go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the “Expand widget templates” box.

Here are some of the possibilities we can adapt to suit the needs and preferences for our individual blogs:

Change the “Subscribe to” phrase (or remove it altogether)

The “Subscribe to” phrase seen in the feed-links generated by our Blogger template comes from the following code tag:

If you prefer to substitute this for your own phrase, you can simply replace this tag with your own phrase. To do this, search for the tag above in your blog’s HTML code and replace the entire tag (including the <>) with the phrase you prefer to use.

For example, in the code below I have substituted with “Subscribe now!”:


<b:includable id=’feedLinksBody’ var=’links’>

<div class=’feed-links’>

Subscribe Now!

<b:loop values=’data:links’ var=’f'>

<a class=’feed-link’ expr:href=’data:f.url’ expr:type=’data:f.mimeType’ target=’_blank’><data:f.name/> (<data:f.feedType/>)</a>

</b:loop>

</div>

</b:includable>


Remove the “(Atom)” from the end of the feed-link

The default feed type generated by our Blogger blogs is “Atom” (XML). Far fewer people are as familiar with Atom feeds than with RSS feeds (which have seemingly become the standard feed type). Generally speaking, Atom feeds work in much the same manner as RSS feeds when viewed in a feed reader. However, the mention of “Atom” beside the feed link may prove confusing for some visitors, so you may want to change this or remove it altogether.

The “(Atom)” part fo the feed-link is generated by the following snippet of code:


<a class=’feed-link’ expr:href=’data:f.url’ expr:type=’data:f.mimeType’ target=’_blank’><data:f.name/> (<data:f.feedType/>)</a>


To remove the “(Atom)”, simply delete the code highlighted in bold. Alternatively you could replace with RSS, though this wouldn’t be strictly honest!

Add an RSS icon to your feed-link

My favorite way to “dress up” the feed-links in Blogger templates is to add a familiar RSS icon to the left of the link.

This visual anchor quickly informs the casual visitor that this link will enable them to subscribe to your blog posts or comment feeds.

Rather than add any code to the feed-links includable, this can be achieved using a little CSS styling. Remember that I mentioned the entire “feed-links” section was wrapped in a DIV with the class of “feed-links”? This is how we can alter that class quickly to add a little RSS icon :)

In the section of your Blogger template, search for the following section:


.feed-links {

clear: both;

line-height: 2.5em;

}


Then add the code in bold to this style declaration:


.feed-links {

clear: both;

line-height: 2.5em;

padding-left: 20px;

background: url(http://lh3.ggpht.com/_xn2gmPb9TfM/SNgRRI_qVPI/AAAAAAAACWU/Qg9HJNnfjgs/s144/feed.gif) left no-repeat;

}


Now if you preview your blog, you will notice the feed-links section has a small RSS icon to the left of the actual link, like this:

Then you can proceed to save your template.

Of course you could replace this feed icon with one of your own choosing if you prefer: simply upload your icon to an online web album or image hosting service, then replace the URL in the code above with that of your own icon instead.

Removing the feed-links altogether

If you have a link to your blog feed elsewhere in your template, you may prefer to do away with the feed-links below your posts altogether!

This is a very simple task to complete. All you will need to do is remove the single line which references the placement of the feed-links includable.

To do this, locate the following line in your blog’s HTML code:


<b:include data=’feedLinks’ name=’feedLinksBody’/>


And delete this entire line. Preview your template before saving to ensure you have successfully removed this line, and if all is well you can proceed to save your template.

Final words

I hope this article has helped you to understand how feed-links work in the posts section of your Blogger template and offered some useful hints for how these links can be altered. Please feel free to add your own suggestions and comments by leaving your messages below.
Stumble Delicious Technorati Twitter Facebook
If you enjoyed this post, make sure you subscribe as an Reader!

1 comments:

Anonymous said...

The actual estate in Malta is now gradually commencing the recovery along with the
charges have changed marginally. Robert Shumake's mission is to inform the public about mortgage fraud and real estate scams and to provide tips on how to avoid being a victim. Property - Hookp takes uses advanced link building and promotion tools to optimize your profile for search engine ranking.

My site :: asunto vuokraus


Post a Comment

← Newer Post Older Post → Home
 

Recent Posts

Recent Comments

Follow Me

UseAds.com - Advertise your site at UseAds.com! Submit your site and get tons of traffic!
UseAds.com - Advertise your site at UseAds.com! Submit your site and get tons of traffic!