Saturday, July 21, 2007

Show Blogger Widgets On Post pages, Particular Page, Home Page

Some times we waste much space on Post pages. So I have a found a solution. Now you can show your particular widget on particular url Or just on Post pages Or Just on Home page.

Here We Go!

Just Click on Add a Page element and select HTML box. Now paste your original Adsense Code. Choose suitable title for your Widget.

Now go to your Blog template. And click on expand the Code. Now after expanding your template, search for the title of the code. In my case I used Advertisement as a title, so I am going to explain with same title.Now proceed further depending your widget placement.

Show Widget On Post-Pages

After you find your code & insert the code shown in bold.

<b:widget id='Advertisement' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.homepageUrl != data:blog.url'>
<div class='widget-content'>
<data:adCode/>
</div>
</b:if>
</b:includable>
</b:widget>

( Method Form Stubborn Fanatics )

Show your Widget On Home Page Only

Now Instead of modifying the code as mentioned above, just modify your code as shown below.

<b:widget id='Advertisement' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.homepageUrl == data:blog.url'>
<div class='widget-content'>
<data:adCode/>
</div>
</b:if>
</b:includable>
</b:widget>

Show your widget on particular page only

If you want to show any widget on particular page, then just modify the code as shown below. Modifications are marked in Bold. Just replace [Your blog page URL here] with actual blog URL.

<b:widget id='Advertisement' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='"[Your blog page URL here]" == data:blog.url'>
<div class='widget-content'>
<data:adCode/>
</div>
</b:if>
</b:includable>
</b:widget>

 This method will enable you to show your widgets on any URL. Go ahead. If you find this post very useful then Bookmark it and Subscribe to feeds for latest updates.