Tagged under:

Display Gadgets only in Home Page in Blogger


This article is about how to set up a gadget / widget in Blogger so that it is only visible on the first place that a reader sees when they visit your blog (often called the "home page")

Step 1: Go to “Template” in Dashboard  and choose “Edit Html” Option.

Step 2:    Find the Gadget-Id  by pressing “Ctrl+F” keys and search the gadget name.

Step 3: Find the code for your gadget:
Example:
 <b:section class='main' id='main' showaddelement='no'>
<b:widget id='Text1' locked='false' title='Test gadget' type='Text'/>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

Step 4: Click on the Expand Widget Templates checkbox (so it's turned on)
After the expanded template, find the widget name again.  This time it will look a bit longer (the exact details depend on what type of widget/gadget it is.)
 <b:section class='main' id='main' showaddelement='no'>
<b:widget id='Text1' locked='false' title='Test gadget' type='Text'>
<b:includable id='main'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != &quot;&quot;'>
  <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
  <data:content/>
  </div>
<b:include name='quickedit'/>
</b:includable>
</b:widget>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>

Step 5:  Add conditional formatting
You need to put conditional formatting code around the code for the gadget - makings sure that it doesn't go around the code for anything else!  (which is why you noted what comes afterwards in step

Copy and pAste this code below this line  <b:includable id='main'>

The code to use is this.  

<b:if cond='data:blog.url == data:blog.homepageUrl'>

and close this code by </b:if>

Thats it Enjoy :)