Friday, July 22, 2011

Put Widget Just in Specific Page,Post or URL

Put Widget Just in Specific Page or Post or URL
There may be some specific Page or post where you would like to show the widget and you may want this widget to appear nowhere except that page. For an when you have widget that gives sense about an iphone application, then you want that widget to display only in the post where you have written about an iphone.
Let me provide another real time example. You have written an about me page in your blog and you want to include Facebook badge of your profile page, then you just want the Facebook badge to appear in your about us page then the solution is right here:

First add the html as you do normally by going to Design , Add elements and HTML.

HTML widget

Now,Goto Edit HTML and Check Expand widget templates and
Then search for
<b:widget id=’HTML1’ locked=’false’ title=’’ type=’HTML’>


html1  here means the code of the widget. Find what is the code for widget you have recently added.Suppose html5 is latest than html4,so depends on the number to find which is the latest


Then after you find <b:widget id=’HTML1’ locked=’false’ title=’’ type=’HTML’>
paste this code just below <b:includable id=’main’>  in this way:


<b:widget id=’HTML1’ locked=’false’ title=’’ type=’HTML’>
<b:includable id=’main’> 
<b:if cond=’data:blog.url == "PAGEURL"’>

Replace PAGEURL with main URL
now just look below
just before </b:includable> add </b:if>
Overall it should look like this

<b:widget id=’HTML1’ locked=’false’ title=’’ type=’HTML’>
<b:includable id=’main’> 
<b:if cond=’data:blog.url == "PAGEURL"’>
.....................
......................
.............................
</b:if>
</b:includable> 

This is really an awesome tip that I have learned. This helps to optimize the look of the blog and allows to put associated widget with the related post or page.
For an instance you can check my about page where you will see the facebook Profile badge which is not visible in any other page.



0 comments:

Post a Comment

You can Comment here. Please make some reasonable Comments. This Blog is Dofollow so get a backlink as a Gift.
Be Sure you use Name@Keywords
Using Keywords directly may make your comments difficult to get approved.

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Enter your email address: