Breaking News
Loading...
Friday, 21 December 2012

Info Post
All About Blogger Conditional Tags
Blogger templates are made using XML format. XML has an extra feature which is user-defined tags.You might have noticed some tags in blogger templates like </b:if> or <b:if cond==""> and more.This are the user-defined tags which blogger includes.This tags are made to make blogging more easy.But many times, bloggers don't know about this tags properly.So to make every one know about this tags in detail this post is written.


Explaining Blogger Conditional Tags:

Code:

<b:if cond='Your Condition'>
Your code or text
</b:if>

 Explaination:

  • <b:if  - Starting of Blogger Conditional tag.
  • cond - Stands for Condition.
  • Your Condition - Put your condition there.
  • Your code or text - The code or text which will will be displayed according to the condition.
  • </b:if> - Closing of Blogger Conditional tag.

Home Page Tags:

Show any thing only on home page:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
Text or code that will be displayed only on Homepage.
</b:if>

Show any thing on all pages except home page:

<b:if cond='data:blog.url != data:blog.homepageUrl'>
Text or code that will be displayed on all pages except Homepage.
</b:if>



Archive Page Tags:

Display any thing only on archive page:

<b:if cond='data:blog.pageType == &quot;archive&quot;'>
Text or code that will be displayed only on archive pages only
</b:if>

Display anything on every page except archive page:


<b:if cond='data:blog.pageType != &quot;archive&quot;'>
Text or code that will be displayed on every page except archive pages
</b:if>



Post Page Tags:

Display any thing only on past pages:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
Text or code that will be displayed only on post pages only
</b:if>

Display any thing on every page except post pages:

<b:if cond='data:blog.pageType != &quot;item&quot;'>
Text or code that will be displayed on every page except post pages
</b:if>



Static Page Tags:

Display any thing only on static pages:

<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
Text or code that will be displayed only on static pages only
</b:if>

Display any thing on every page except static pages:

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
Text or code that will be displayed on every page except static pages
</b:if>



Specific URL Tags:

Display any thing on specific url only:

<b:if cond='data:blog.url == &quot;Your URL&quot;'>
Text or code that will be displayed only on the above url page
</b:if>



Specific Label Tags:

Display anything only on specific tags pages:

<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Your Specific Tag&quot;'>
Text or code that will be displayed only on the specific tag page
</b:if>
</b:loop>



Now you have learned in details about all the <b:if> tags of blogger.

0 comments:

Post a Comment