Friday, 12 June 2009

Creating a Separate Archive Page or Labels Page for blogger

Many bloggers dont prefer to display the blog archive and the labels on each and every page of their site. They may wish to create a separate page for the Blog Archives. I have made one such implementation of a blog archive here . You can also check out my label cloud page .

So i think you guys understood what i am trying to explain.



Ok lets get into the details of doing this. Blogger allows little bit of programming.Those who have coded using C or any simple programming language might surely have used the conditional if statements. The same thing is there for the blogger template also.learn about these conditional tags over here and come back..

So how are we going to do this..First we will make a blank post with an appropriate title.In this case i have made a post with title "Label Cloud" .Also make sure that you have disabled comments on this post .You can do that from the Post Options in your Post Editor. When making the post set the post date to a little earlier date so that this post wont reflect in your feed.(You can do that in the post options in your post editor).Now we have created a page where we want to display our blog label cloud. Note that url. We will need it

Now we are going to make a new label gadget.For this goto Blogger > Template > Page Elements and add a Label gadget.Drag it just below the blog post gadget.

Ok now we will get a label gadget on every page of our blog.(If you want you can convert the label widget into a cloud)Now we want to hide the blogpost widget on this particular label page.For this we use conditional tags..
I placed the following code just below ]]></b:skin>








<b:if cond='data:blog.url == &quot;http://www.bloggerplugins.org/2005/06/label-cloud_06.html&quot;'>

<style>

.post{display:none;}

.comments-block{display:none;}

.comment-form{display:none;}

.comment-footer{display:none;}

.blog-pager{display:none;}

.feed-links{display:none;}

.comments{display:none;}

</style>

</b:if>





Now the Blog Post widget will be hidden in the Label Cloud Post Page.The label cloud appears on every blog page.Now we have to make it invisible on other pages(pages other than the cloud page).To make a widget invisible we have to wrap conditional tags within the main b:includable of the widget.Other B;includables needn't be wrapped as they are called from the main includable(This can be compared to main function and other functions in C. If the main function is disabled,the program wont work.Similarly if the main includable is disabled,then the widget will be hidden).The general structure of a any widget looks like

<b:widget id='something' locked='false' title='something' type='something'>

<b:includable id='main'>

----

----

----

</b:includable>

Other includables //Not Present in Label Widget
</b:widget>



Now we have to impose the conditions within the widget which will make the structure to






<b:widget id='something' locked='false' title='something' type='something'>

<b:includable id='main'>

<b:if cond='data:blog.url == &quot;http://www.bloggerplugins.org/2005/06/label-cloud_06.html&quot;'>

----

----

----

</b:if>

</b:includable>

Other includables //Not Present in Label Widget
</b:widget>



Similarly we can create a separate archive page also..
Remember that the Archive widget has more than one b:includables..You just need to hide the main includable..
.

Note:In this tutorial you will have to modify the URLS properly.I have used my blog urls for explanation.This method doesn't cause problems with rearranging of Widgets in the Page Elements Tab.


Permalink:Creating a Separate Archive Page or Labels Page for blogger
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "Creating a Separate Archive Page or Labels Page for blogger"

Post a Comment