9 Add a "breadcrumb" trail and status messages to your blog
Thursday, October 2, 2008 /

An important (and often overlooked) aspect of good blog design is navigation. In order to encourage visitors to read more of your posts, stay longer and make repeated visits, you need to make it easy for readers to navigate and find the information they need!



Adding a list of related posts, links to recent articles and easily accessible categories are among the most effective techniques. Another method which I have noticed in many popular blogs is the "breadcrumb trail": a message above posts which explains how the page being read fits into the heirachy of the blog, with liks to the containing categories.



Hoctro wrote a very useful tutorial which explains how to add a "breadcrumb trail" on item pages in Blogger. However, I preffered to use a method which would display a message on all pages of the blog, including Archives and Search/Label pages. So in this tutorial, I'll explain how to add a status message for each page of your blog, with links to the containing pages for easy reference and increased page views.









How the status messages will appear in your blog

Here are some screenshots of how this customization would appear in your blog design:



On the home page:





On item pages:





On archive pages:





On search/label pages:





 
As you may notice, the default "status message"which appears on your search/label pages is replaced by this new breadcrumb trail, ensuring that this area blends completely with your blog design.



I have tried to ensure the code used in this tutorial will allow the "breadcrumb trail" to blend with other elements of your template, though you can also customize the code and styling to control the design even more.









How to add the "breadcrumb trail" to your Blogger template

This is a surprisingly easy customization to add to your Blogger template, and can be achieved in only three steps:









Step 1

Go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the "expand widget templates" box.









Step 2

Using your browser search function, locate this exact phrase in your Blogger template code:







<b:include data='top' name='status-message'/>
Replace this entire line with the following block of code:







<div id='places'>

<b:if cond='data:blog.homepageUrl == data:blog.url'>

      <div class='breadcrumbs'>

Welcome to <data:blog.title/>

</div>

<b:else/>

  <b:if cond='data:blog.pageType == &quot;item&quot;'>

      <div class='breadcrumbs'>



          <a expr:href='data:blog.homepageUrl' rel='tag'>Home</a> 

  <b:loop values='data:posts' var='post'>

    <b:if cond='data:post.labels'>

      <b:loop values='data:post.labels' var='label'>

            <b:if cond='data:label.isLast == &quot;true&quot;'> &#187;

              <a expr:href='data:label.url' rel='tag'><data:label.name/></a>

            </b:if>

 &#187; <span class='post-title entry-title'><data:post.title/></span>

      </b:loop>

    </b:if>

  </b:loop>

         



      </div>

  </b:if>

<b:else/>

<b:if cond='data:blog.pageType == &quot;archive&quot;'>

<div class='breadcrumbs'>

<a expr:href='data:blog.homepageUrl'>Home</a> &#187; Archives for <data:blog.pageName/>

</div>

</b:if>

<b:else/>

  <b:if cond='data:navMessage'>

<div class='breadcrumbs'>

<data:navMessage/>

</div>

</b:if>

</b:if>

</div><!-- end places -->








Step 3

Find the closing </b:skin> tag in your template (again using your browser search function if it is helpful).



Just before this tag, add the following lines of code:









#places {

  border: 1px solid $bordercolor;

  padding: 5px 15px;

  margin: 10px 0;

  line-height: 1.4em;

}


If your template does not include the variable $bordercolor, replace this phrase with the hex value of a chosen color instead (eg: #000000 for black).



Now preview your template. In the preview, you should see the "Welcome to [your blog name]" message which tells you this customization has worked. If nescessary, you may want to add more margins/padding/a background color to the style statements for #places.



Once you have finished, you are ready to save your template. You can then take a look at various pages in your blog to see how this breadcrumb trail operates.









Your opinions?

I hope this tutorial may be a useful method for enhancing navigation and page-views in your own Blogger template. Please let us know what you think of this hack or how you may have adapted this for your own requirements by leaving a comment below.



9 comments:

April 18, 2009 at 5:33 AM Omi said...

Hi, I can't get this to work on my blog. I'm using this template

http://www.jackbook.com/blogger-templates-gallery/rainbow-garden-blogger-template

my blog is:

http://theidleduck.blogspot.com

I don't have the code mentioned in step 2. If anyone can have a look and tell me how to do it I'd be very grateful. Thanks.

April 18, 2009 at 5:06 PM Mrs. Darling said...

Okay I got this to work just fine but why does it just say Welcome to Dishpan Dribble, my blog name? Am I suppose to add a label in there? If so how?

May 20, 2009 at 8:09 PM ed hardy said...

There are ed hardy shirts
,pretty ed hardy shirt for men, ed hardy womens in the ed hardy online store designed by ed hardy ,many cheap ed hardy shirt ,glasses,caps,trouers ed hardy shirts on sale ,
You can go to edhardyshirts.com to have a look ,you may find one of ed hardy clothing fit for you
http://straighthairgirl.blog126.fc2.com
http://www.seriousblogging.com/crazygirlsshirts
http://www.free-blog-site.com/iammyself
http://d.hatena.ne.jp/hotfishing
chaussure pumachaussure sport chaussure nike

June 1, 2009 at 10:34 PM Love Poetry and fun jokes said...

check my cool sites:

http://lovepox.blogspot.com/

I like this site very much... plz provides us some simple template.with rightside sidebar a box. and below 2 more sidebar.

June 2, 2009 at 11:44 AM Bruce Hembd said...

I have found a way to show multiple labels assigned to one posts. In addition to Fernando's correction to fixed the looping titles, remove the bolded lines as noted below:

<b:if cond='data:label.isLast == "true"'> &#187;

<a expr:href='data:label.url' rel='tag'><data:label.name/></a>

</b:if>I did this and VIOLA multiple labels appeared in the breadcrumb trail. I also rearranged the breadcrumbs so that it looks like:

HOME » post title » multiple-labels

This hierarchy seemed more logical, to me anyway, for multiple labels.

My blog where I used this technique (in addition to a Hoctro script.)

The complete edited code:

<!-- breadcrumb bloggerbuster -->

<div id='places'>
<b:if cond='data:blog.homepageUrl == data:blog.url'>
<div class='breadcrumbs'>
Welcome to <data:blog.title/>
</div>
<b:else/>
<b:if cond='data:blog.pageType == "item"'>
<div class='breadcrumbs'>
<a expr:href='data:blog.homepageUrl' rel='tag'>HOME</a>

<b:loop values='data:posts' var='post'>
&#187; <strong><data:post.title/></strong>

<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
&#187; <a expr:href='data:label.url' rel='tag'><data:label.name/></a>
</b:loop>
</b:if>
</b:loop>
</div>
</b:if>
<b:else/>
<b:if cond='data:blog.pageType == "archive"'>
<div class='breadcrumbs'>
<a expr:href='data:blog.homepageUrl'>HOME</a> &#187; Archives for <data:blog.pageName/>
</div>
</b:if>
<b:else/>
<b:if cond='data:navMessage'>
<div class='breadcrumbs'>
<data:navMessage/>
</div>
</b:if>
</b:if>
</div><!-- end places -->

<!-- breadcrumb bloggerbuster -->

June 20, 2009 at 5:24 AM
Anonymous said...

How do you know the total number of search results in a blogger search

August 31, 2009 at 12:22 AM share tips expert said...

We all get bombarded every day with mails, morning briefs as to which stock we should pick and how will be the market trend today. Every time the brokerage houses will send the stock market tips as if we all are playing a gamble and need the tricks as to how we can win it. And anticipating as to how to do stop loss and at least will make smaller profits. What most of the investor do is they consider short term trading as the long term investment and believe as to how it can be doubled in a day. Buying a stock just because the price is low and some stock market tip you received that this will boom in the market today. What most of us do is that we all trade with money which we can’t afford to lose but the market always says that invest only that money which is in excess to you. All of these are the big mistakes which we commit every day in spite of being reminded every time that we should complete our home work for the next day.

www.sharetipsexpert.com

Post a Comment