Add article to a page in blogspot(Transform a Blogger label into a page)

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://nharua.blogspot.com/search/label/Template%20Joomla' title='my tab'>My tab</a></li> 
<b:else/> 
<li>
<a href='http://nharua.blogspot.com/search/label/Template%20Joomla' title='My book reviews'>Book reviews</a>
</li> 
</b:if>

Naturally, the italicized text should be replaced with your own blog name and labels. And the fragment ?max-results=7 is optional; it just forces Blogger to display only 7 articles for the label, making it consistent with the rest of my blog. You can change the number to anything you like or need.
This code also takes care of highlighting the page title when somebody visits it to closely match the look of a native page. If the template doesn’t use that option, or if you are linking to an external page, you can remove the conditions from this code and simply use a hyperlink inside a list tag. The only thing missing now would be to replace the general RSS feed of the blog with the feed for the label on this sub-page, but I haven’t figured out how to do that for now.
Unfortunately the method described above has a small disadvantage: because of the way the ‘Pages’ widget is built, you can’t add custom links between the regular pages, only before or after them. So if you use this hack on your blog, the manually inserted links will be displayed either on the left or on the right side of the other pages in the widget.
An alternative would be to use the method described here. It uses the standard Blogger feature, so you can place the newly created page anywhere in the widget, but doesn’t show the full articles and requires the use of third-party tools like Google Analytics and FeedBurner.

0 nhận xét:

Post a Comment