Some Conditional Tag Functions On blog Widgets

Some Conditional Tag Functions On Widgets - There are some tricks to hide blog elements either on homepage/home page, post, or static page by adding conditional tag code in every element you want to hide.
For the latest version of blogger conditional tags, you can check here Latest Blogger Conditional Tags

Examples of implementation:

<b:if cond='data:blog.pageType != "static_page"'>
..... Fill content to be wrapped conditional tag (Content will be hidden in static page) .....
</b:if>

It not only hides an element but can also display certain elements on only one page you specify. 

Examples of implementation:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
..... Fill content to be wrapped conditional tags (Content will only appear on home page) .....
</b:if>

for more details please see some conditional tag function for widget below:

1. Displays widgets only on the homepage


<b:widget id='HTML1' locked='false' title='Recent Posts' 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 != ""'>
<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. Displays widgets only on the posting page


<b:widget id='HTML1' locked='false' title='Recent Posts' 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 != ""'>
<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. Displays widgets only on certain pages


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "Your URL"'>
<!-- 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>

Note: Replace your URL with the address you want.

4. Hiding widgets only on certain pages


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url != " Your URL "'>
<!-- 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>

5. Display widgets on static pages


<b:widget id='HTML1' locked='false' title='Recent Posts' 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 != ""'>
<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. Hiding widgets on static pages


<b:widget id='HTML1' locked='false' title='Recent Posts' 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 != ""'>
<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>

7. Show widget only on archive page


<b:widget id='HTML1' locked='false' title='Recent Posts' 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 != ""'>
<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>

8. Display widgets only on the index page


<b:widget id='HTML1' locked='false' title='Recent Posts' 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>

9. Hiding widgets on the index page


<b:widget id='HTML1' locked='false' title='Recent Posts' 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>

Deployment of certain content


This is the conditional tag you want to add under certain conditions, such as HTML, CSS, Javascript, etc.

Conditional tags for specific labels


<b:if cond='data:blog.searchLabel'>
  <div class='arlinadesign'>CONTENT HERE</div>
</b:if>

Example:

<b:if cond='data:blog.searchLabel == "NAMA LABEL"'>
  <div class='arlinadesign'>CONTENT HERE</div>
</b:if>

The conditional tag for a particular search page


<b:if cond='data:blog.searchQuery'>
  <div class='arlinadesign'>CONTENT HERE</div>
</b:if>

Example:

<b:if cond='data:blog.searchQuery == "NAMA LABEL"'>
  <div class='arlinadesign'>CONTENT HERE</div>
</b:if>

After you add conditional tags above, save the template and see the results. 

Not limited to the widget, with conditional tags you can wrap the other elements such as ScriptCSS, and HTML in the template for reasons accelerate blog by reducing Script contained in a page or other privacy reasons. 

Maybe useful.