Blogger and conditional widgets

Quick note that to make a widget/gadget conditional in Blogger you need to edit the template's HTML and add a <b:if cond='... tag. For example, the following makes the given HTML widget only display on the index page (the main page).
<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == &quot;index&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>

This can be useful if you want some introductory content to be displayed to the viewers of the home page but not to viewers of of the specific posting pages.

Also, a new feature of Blogger is "Pages". Pages are named postings that can be listed and accessed by direct links. There is also a widget for showing the pages as a list or as tabs.

No comments: