Thursday, January 9, 2014

How to show gadget in Specific pages

In the default coding of a template, gadgets are set to appear in every pages of the Blog but sometimes we do not want to show a gadget in a specific page. It can be done by tweaking the templates codes. There may be different ways but I like the one stated bellow……
1) Find out the widget ID (to which you will impose the change) by using the following tutorial
    How to delete a Widget from Blogger template ( Follow up to step 4)
2) Note the widget ID
3) Now Go to Template-----Edit HTML-----Proceed------Expand Widget Template
4) Press Ctrl+F and search for the widget ID
5) After successfully searching the ID in the template,you will get to see a line of code like this
<b:includable id=main> 
6) Now add the following codes after the step[ 5] code
To show the Widget only on Homepage 
<b:if cond=data:blog.url == data:blog.homepageUrl>

To show the Widget only on Post pages
<b:if cond=data:blog.pageType == "item">

To show the widget in a specific page
<b:if cond=data:blog.url == "Blog Post URL">
Now replace the “Blog Post URL” with the specific post page URL in which you want show the widget

7) Now scroll down till you see the first  </b:includable> tag and after that place a closing </b:if> tag just before it as i have shown in the following
Thats it.....

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.