Tuesday, October 4, 2011

How To Transform a Blogger label into a page ?

Today I was making another page to my blog and wanted to connect it with label, but I did not get easy then i searched it and I found solution.
As always, make sure to back-up your template before making any changes to it. After that check the box ‘Expand Widget Templates’ to begin editing the full HTML template. Search for the following line that marks the beginning of the ‘Pages’ widget: 
 
<b:widget id='PageList1' locked='false' title='Pages' type='PageList'> 
 
You can insert your own links after the main code loop closes, that is after the line </b:loop>. For example, to add a label page here you need the following code:

<b:if cond='data:blog.pageTitle == &quot;Fors: Book&quot;'>  
<li class='selected'><a href='http://tech-trickss.blogspot.com/search/label/Downloads?max-results=5' title='Downloads Free EBook'>Downloads</a></li>  
<b:else/>  
<li><a href='http://tech-trickss.blogspot.com/search/label/Downloads?max-results=5' title='Downloads Free EBook'>Downloads</a></li>  
</b:if>

Naturally, the italicized text should be replaced with your own blog name and labels. And the fragment ?max-results=5 is optional;  It just forces Blogger to display only 5 articles for the label, making it consistent with the rest of my blog. You can change the number to anything you like or need.

Now Enjoy Blogging :-)

1 comment:

  1. Should I change the Fors: Book ?
    It didnt work on mine.. or should I add the Pages before I paste the code? I really frustrated

    ReplyDelete