Blogi
Free Blog Tools

For those of you who want to display the widget only on a specific page (whether it be advertising or list link) maybe this could help you.

But before you do it, we must know in advance the types of pages on blogspot or blogger. To find out you can see in my previous post, titled Knowing, 7 types of blogspot page.

As you already know the first way is to go into your blogger account. Select Design> Edit HTML and check Expand Widget Templates. To avoid undesirable first you should backup your blogger template.

Find the widget code that you create to appear on certain pages, such as the code below:
<b:widget id='HTML1' locked='false' title='YOURWIDGETTITLE' type='HTML'>
<b:includable id='main'>
  <! - Only display title if it's non-empty ->
  <b:if cond='data:title != ""'>
    <h2 class='title'> <data:title/> </h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
  </div>

  <b:include name='quickedit'/>
</b:includable>
</b:widget>
For example, if you want to display the widget is only on the main page then add the following code after <b:includable>.

<b:if cond='data:blog.pageType == "index"'>

and add the following code before </ b: includable>

</b:if>

Then the code will look like this:
<b:widget id='HTML1' locked='false' title='YOURWIDGETTITLE' type='HTML'>
<b:includable id='main'> <b:if cond='data:blog.pageType == "index"'>
  <! - Only display title if it's non-empty ->
  <b:if cond='data:title != ""'>
    <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>
Or if you just want to display the widget on just one meal a specific page add this code after <b:includable>.

<b:if cond='data:blog.url == "http://www.YOURDOMAIN.blogspot.com/p/YOURPAGE.html"'>

and add the following code before </ b: includable>

</b:if>

Then the code will look like this:
<b:widget id='HTML1' locked='false' title='YOURWIDGETTITLE' type='HTML'>
<b:includable id='main'> <b:if cond='data:blog.url == "http://www.YOURDOMAIN.blogspot.com/p/YOURPAGE.html"'>
  <! - Only display title if it's non-empty ->
  <b:if cond='data:title != ""'>
    <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>
After that save your template, then open your blog. Whether your widgets only appear on a specific page or just the pages you want or not. If there could be no mistake in placing the code. This trick may be useful to you.

3 Responses so far.
  1. admin says:

    thank's it's work for me :D

  2. Anonymous says:

    Gw mwnya yang perlabel gimana tuh jadinya

  3. admin says:

    if you want to make the widget look different in each label you can use a script like this:

    <b:if cond='data:blog.searchLabel == "YourLabel1"'> content </ else>
    <b:if cond='data:blog.searchLabel == "YourLabel2"'> content </ else>
    content
    </ b: if> </ b: if>

Post a Comment