Showing a gadget on your Blogger homepage only

November 4, 2008 | Bookmark and Share

A gadget that you added on Sidebar or Footer always appears on our homepage and all posts pages. But you can custom its contents that are only shown on your homepage or each post page through this example.

By signing in Blogger, click on Layout tab | Edit HTML and check the "Expand Widget Templates" box. Use search keywords below to find your gadget:



For example, I want to set up for id='HTML1'. Pay attention to the highlighted code added into your template, this makes your gadget be shown on homepage:

<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<!-- 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:if>
</b:includable>
</b:widget>


On the other way, this is shown on each post page:

<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<!-- 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:if>
</b:includable>
</b:widget>


in Labels: ,
Share/Save/Bookmark Subscribe

What's Next?

Related Posts by Categories


1 comments: to Showing a gadget on your Blogger homepage only so far ...

Marty191 said...

thx, it works

Post a Comment