» Blogger » Blogger Label Functions (The Basics)

Amanda FazaniBlogger Label Functions (The Basics)

Written by Amanda Fazani from Blogger Buster on September 15, 2008

When publishing with Blogger, we can categorize our posts using “Labels”. Published posts which have labels attached produce a link to each label in the post-footer section which links to a page displaying all posts categorized under this label. We can also add a “Labels” widget which generates a list of all labels currently in use linking to posts in the appropriate category.

Aside from the basic categorization of blog posts, there are some other useful functions we can add to our blogs when using Blogger labels. In this post, I’ll explain some simple yet useful customizations which could be useful to enhance the organization and display of your Blogger posts.

Create a Label Cloud

“Tag Clouds” are a popular design feature often used in blogs. This enables you to display links to your labels (categories) in a cloud style, where prominent labels feature more prominently and offer readers an understanding of your blog’s subject matter.

More recently, Blogger users have been able to add a flash-based, animated tag cloud to their layout which is based on the popular WP Cumulus plugin by Roy Tanck. This stylish version can be included in a regular Labels widget to parse and display labels automatically.

Further reading for label clouds:

Limit the number of posts displayed on label pages

By default, label pages display 25 posts assigned to that particular category (if there are enough posts filed under that label).

For those who write long posts or use many images, this can result in long page-load times for label-based blog pages.

Here is an easy way to limit the number of posts displayed on label pages:

  1. Go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the “Expand widget templates” box.
  2. Using the search function of your browser, find every instance of this phrase:
    data:label.url

    and replace this with the following instead:

    data:label.url + "?max-results=n"

    where n is the number of posts you would like to display on labels pages. This can be any number between 1 and 100.

This customization offers more control over the number of posts displayed, and can help ensure your Blogger design looks and feels the way you want it to.

Use a drop-down menu for your labels

If you have a long list of labels in use, a simple labels widget would appear as a big long list.

To free up some space in your sidebar, you may want to consider using a drop-down menu instead.

This is another simple customization for your blog which can be achieved in just a few short steps:

  1. Go to Layout>Edit HTML in your Blogger dashboard. This time, do not check the “expand widget templates box!
  2. Using your browser’s search function, locate the following line of code:
    <b:widget id='Label1' locked='false' title='Labels' type='Label'/>
  3. Replace this line with the following code instead:

    <b:widget id=’Label1′ locked=’false’ title=’Labels’ type=’Label’>
    <b:includable id=’main’>
    <b:if cond=’data:title’>
    <h2><data:title/></h2>
    </b:if>
    <div class=’widget-content’>

    <br />
    <select onchange=’location=this.options[this.selectedIndex].value;’>
    <option>Select a label</option>
    <b:loop values=’data:labels’ var=’label’>
    <option expr:value=’data:label.url’><data:label.name/>
    (<data:label.count/>)
    </option>
    </b:loop>
    </select>

    <b:include name=’quickedit’/>
    </div>
    </b:includable>
    </b:widget>

  4. Finally, save your template.

Once you have installed this hack, you will see that your label list has been replaced with a simple drop-down menu instead, which readers can use to access label pages with ease.

Access and display posts from label feeds

A lesser known feature of Blogger is that each blog produces label feeds in addition to the regular post and comment feeds.

If a particular category of posts is of interest for your readers, it may be useful to promote certain label feeds or add a recent posts widget to display articles categorized under this label.

Label feeds can be accessed using the following format:

http://your-blog.blogspot.com/feeds/posts/default/-/LabelName

where “your-blog.blogspot.com” should be replaced with your own blog URL, and “LabelName” should be the name of the label you wish to publicize (case sensitive).

If there are spaces between words in your label names, replace these spaces with %20 instead.

For example, the label feed for “Labels Categories and Tags” in my blog, Blogger Buster, is located at the following URL:

http://www.bloggerbuster.com/feeds/posts/default/-/Labels%20Categories%20and%20Tags

Once you have located the URL for your label feed, you could burn this through FeedBurner and offer subscriptions or add as a recent posts widget to filter posts from this category. It is also a useful method of displaying a “sideblog” with Blogger.

More Label Hacks Coming Soon…

In this post, I’ve discussed only the basic methods of manipulating labels in Blogger blogs. There are also advanced techniques which we can use to filter posts depending on their label (ideal for magazine style layouts, side-blogs and similar functions), and also to generate interesting functions for label pages and particular categories of posts.

So in next week’s post, I’ll continue with the theme of Blogger labels by explaining some of the more advanced label-based functions which offer even greater control over your posts and layouts.

Written by Amanda Fazani from Blogger Buster on September 15, 2008 | Filed Under Blogger

Share with others

  • StumbleUpon
  • Add to Delicious
  • Mixx
Make money with LinkXL

10 Responses so far | Have Your Say!

  1. Jos  |  September 15th, 2008 at 5:35 pm #

    Jos - Gravatar

    Hello Amanda,
    Jut what I needed for the long list of labels
    Unfortunately I get an error message when I try to save the Template:
    Quote:
    Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: Open quote is expected for attribute “{1}” associated with an element type “id”.
    end Quote

    Perhaps you can tell me what I’m doing wrong?
    Thanks

  2. Sunil Pathak  |  September 15th, 2008 at 10:27 pm #

    Sunil Pathak - Gravatar

    Hi Amanda

    this is really cool tutorial for Blogspot publisher, it will give a sleek look to blogspot blog which we usually see only on wordpress blogs.

    @Jos

    change the lable id in this code

    make it Lable11 that should solve your problem :grin:

  3. Sunil Pathak  |  September 15th, 2008 at 10:48 pm #

    Sunil Pathak - Gravatar

    @Jos ignore my 1st reply

    pleas replace all single quotation marks * ‘ * with double quotations * ” *

    and your drop down label list will be working smoothly :eek:

  4. Jos  |  September 16th, 2008 at 8:10 am #

    Jos - Gravatar

    Sunil,
    Doesn’t work either../… :?:

  5. Sunil Pathak  |  September 16th, 2008 at 10:28 am #

    Sunil Pathak - Gravatar

    @Jos

    try this code



    Select a label

    ()

    if this one give you any more error then pleas mail me on sunil@bloggerslab.com

    its batter to solve your problem on email rather then series of comments on this informative post ;)

  6. Sunil Pathak  |  September 16th, 2008 at 10:32 am #

    Sunil Pathak - Gravatar

    bloody hell i am not allowed to use blockquote here :cry:

    some one pleas delete my previous comment

    @Jos mail me the error you are getting after replacing * ‘ * with * ” *

  7. Russ  |  September 18th, 2008 at 12:58 pm #

    Russ - Gravatar

    Wondering if anyone know how to edit the title tags of the “labels” page. Every labels page that is indexed within Google has the name of the blog in the title tags.

    I would love to create unique title tags for each labels page for SEO purposes….

  8. SBA  |  September 18th, 2008 at 2:07 pm #

    SBA - Gravatar

    1. I added the drop down menu for Labels and it worked fine. Until I realized the post counts were there — Last week I had gone in and deleted the
    () line to have a cleaner look. Finally figured out that copying all of your replacement code caused the resurrection. So I went in to delete it again, but it was not there — now you can only see it with “expand widget templates box checked. But now I get a Blogger error(Bx-nnn) trying to preview or save the changes. Actually I can’t even preview when I make no changes in expand mode. HELP! :???:

    2. Your instructions say “This time, do not check the “expand widget templates box!”, but by doing that the next time you try to find that new code you need to check show expanded — you might want to warn folks in case they want to reverse the drop-down into a plain list. Although, there is no record of the code that was replaced???

  9. SBA  |  September 18th, 2008 at 4:22 pm #

    SBA - Gravatar

    Re: my item 1 in the previous comment — the Bx-nnn error clear up! :grin: I had filled out the ‘report blogger error’ form which may have triggered something on their end (?)

  10. matsaed  |  November 18th, 2008 at 9:50 am #

    matsaed - Gravatar

    thanks alot………guy

Trackbacks to 'Blogger Label Functions (The Basics)'

Comments are closed since this post is older than 30 days. However, you can continue this discussion in our popular Blogging Forums