Tuesday, September 8, 2009

Show widgets in only specific pages or homepage - Blogger Help

Once you activate any widget, in your blog, it will be displayed in all the pages by default, including your homepage.
But sometimes, we do want to show some widgets only on Homepage or only for the individual posts pages, or only in a specific page, the coding is quite simple, but you need to customize the widget through the "Edit HTML" link in your "Layout" section.

Follow these steps:
Create any widget, and place it where-ever you want, and save the template. Check if it is working (should be displayed in all the pages). Remember to give a TITLE to it, like Archives/BlogRoll/Maps/Clock, anything unique.

Now go to "Edit HTML" page.
Click/mark "Expand Widget Templates"
Then find for that unique Title (by searching through CTRL+F method)
It will be something like this:
widget id='HTML3' locked='false' title='UNIQUE WORD OR TITLE HERE' type='HTML'>











widget>

Now tweak this as follows

To display the code only in HomePage
widget id='HTML3' locked='false' title='UNIQUE WORD OR TITLE HERE' type='HTML'>

blog.url == data:blog.homepageUrl'>










widget>

To display widget in "All Posts", but NOT in HomePage
widget id='HTML3' locked='false' title='UNIQUE WORD OR TITLE HERE' type='HTML'>

blog.pageType == "item"'>










widget>

To display widget in any specific page
widget id='HTML3' locked='false' title='UNIQUE WORD OR TITLE HERE' type='HTML'>

blog.url == "SPECIFIC_BLOG_POST_URL"'>










widget>
Add those code lines in red color, as per your requirement.

0 comments:

Post a Comment