1 - Principle And Syntax Of Blogger Conditional Tags

The principle of using conditional tags is simple: a condition is defined and the content will be executed according to a particular case. These tags can be inserted in the HTML code of the template as well as in an HTML / Js gadget.

In general, the syntax is as follows:

If Condition
--- Run this part ---
Else
--- Perform this other part ---
End if

2 - The Different Types Of Blogger Pages And Conditional Tags To Use

Blogger Home page

You can make a content or gadget visible only on your home page by using:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
--- content visible only on home page ! --
</b:if>

Articles pages (message,post) or Items

<b:if cond='data:blog.pageType == "item"'>
--- content visible only on page type = item ---
</b:if>

Index pages

It refers to all the other pages except the articles pages, ie the home page, labels, archives and research.

<b:if cond = 'data: blog.pageType == "index"'>
--- Content visible on all pages except the articles pages ---
</b:if>

Show content only on specific url

<b:if cond='data:blog.url == "your_url">
--- Content visible only on this your_url ---
</b:if>

Show content only on static page

<b:if cond=’data:blog.pageType != "static_page">
--- Content visible only on static page ---
</b:if>

Show Widget or content only at Label Pages

<b:if cond='data:blog.searchLabel'>
--- Content visible only at label page ---
</b:if>

Content visible only on specific label page

<b:if cond='data:blog.searchLabel == "your_label"'>
-- content visible on label 'your_label' --
</b:if>

Show Widget or content only at Archives Pages

<b:if cond='data:blog.pageType == "archive"'>
--- Content visible only at archives pages ---
</b:if>

More condition blogger tags

<b:if cond='data:post.showBacklinks'><-Your conditional content---></b:if>
<b:if cond='data:displayname == "specific-name"'><-Your conditional content---></b:if>
<b:if cond='data:post.numComments == [number_here]'><-Your conditional content---></b:if>
<b:if cond='data:post.hasJumpLink'><-Your conditional content---></b:if>
<b:if cond='data:post.allowComments'><-Your conditional content---></b:if>
<b:if cond='data:blog.metaDescription'><-Your conditional content---></b:if>
<b:if cond='data:mobile'><-Your conditional content---></b:if>
<b:if cond='data:title'><-Your conditional content---></b:if>
<b:if cond='data:title != ""'><-Your conditional content---></b:if>
<b:if cond='data:showThumbnails == "false/true"'><-Your conditional content---></b:if>
<b:if cond='data:showSnippets == "false/true"'><-Your conditional content---></b:if>
<b:if cond='data:post.thumbnail'><-Your conditional content---></b:if>
<b:if cond='data:display == "list"'><-Your conditional content---></b:if>
<b:if cond='data:blog.url == data:label.url'><-Your conditional content---></b:if>
<b:if cond='data:showFreqNumbers'><-Your conditional content---></b:if>
<b:if cond='data:useImage'><-Your conditional content---></b:if>

Younes Derfoufi
my-courses.net

Leave a Reply