Monster-Shared™ Monster-Shared™ Monster-Shared™ Monster-Shared™ Monster-Shared™
  • Monster-Shared™
  • Monster-Shared™
  • Monster-Shared™
  • Monster-Shared™
Monster-Shared™
Monster-Shared™
Sabtu, 25 Mei 2013

Cara Menampilkan Widget Hanya di Halaman Tertentu



Hai Sahabat Blogger. Kali ini saya akan memberikan Tutorial mengenai bagaimanamenampilkanWidget hanya pada halaman tertentu dengan menggunakan Tag Kondisional.






Untuk menampilkan widget di halaman tertentu, anda harus menambahkan conditional tags (b:if cond) pada elemen widget yang diinginkan. Berikut ini adalah langkah-langkahmenambahkannya.


Masuk ke halamantemplate (Dashboard > Template)
Klik "Edit HTML"
Silahkan pilih widget yang ingin anda pilih
Jangan lupa klik tanda ini ►


Cara Menampilkan Widget Hanya di Halaman Utama/Indeks (Homepage)

<b:widget id='HTML11'locked='false' title='' type='HTML'>
<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>


Cara Menampilkan Widget Hanya di HalamanPosting

<b:widget id='HTML11' locked='false' title='' type='HTML'>
<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>



Cara Menampilkan Widget Hanya di HalamanStatis

<b:widget id='HTML11' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType !="static_page"'>
<!-- 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>


Cara Menampilkan Widget Hanya di Halaman Arsip (Archive)

<b:widget id='HTML11'locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType =="archive"'>
<!-- 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>



Cara Menampilkan Widget Hanya di SalahSatu Halaman (Berdasarkan URL)

<b:widget id='HTML11' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "Ganti dengan URL Halaman di sini"'>
<!-- 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>



5. Setelah conditional tags ditambahkan, save template.
Newer
(˘ε˘ƪ) This Is Most Post :3
Posting Lama

0 komentar►

Posting Komentar

 

About Me

Foto Saya
Hey there! My name is Khairil Anwar and I’m a design geek from Makassar, Indonesia. I’m addicted to Adobe Illustrator, maniac for pixel perfection and continuously searching for new techniques and aesthetics. This website is all about sharing my passion and knowledge with you. So feel free to look around and you might find useful stuff for your projects.