24.3.11

Hack Tampilan Widget Blogger

Berikut trik untuk menampilkan widget kita secara suka-suka. Mau widget tampil hanya di halaman depan saja (home page), mau tampil pada sesi postingan (single post) dan URL secara spesifik.

1. To display the code only in Home Page.

<b:widget id=’ID WIDGET‘ locked=’false’ title=’UNIQUE TITLE HERE‘ type=’TYPE WIDGET‘>
<b:includable id=’main’>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!– 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>
2. To display widget in “All Posts”, but not in Home Page.
<b:widget id=’ID WIDGET‘ locked=’false’ title=’UNIQUE TITLE HERE‘ type=’TYPE WIDGET‘>
<b:includable id=’main’>
<b:if cond='data:blog.pageType == "item"'>
<!– 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>
3. To display widget in any specific page.
<b:widget id=’ID WIDGET‘ locked=’false’ title=’UNIQUE TITLE HERE‘ type=’TYPE WIDGET’>
<b:includable id=’main’>
<b:if cond='data:blog.url == "Specific_Blog_Post_URL"'>
<!– 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>

Loading...
Loading...