Latest Blogger Conditional Tags

Here are the Latest Blogger Conditional Tags that you can add to your theme to wrap certain markup like HTML and Widgets.
Latest Blogger Conditional Tags







Here are the Latest Blogger Conditional Tags that you can add to your theme to wrap certain markup like HTML and Widgets.

Main Page Conditional Tags

New Version
<b:if cond='data:view.isHomepage'> … </b:if>
Old Version
<b:if cond='data:blog.url == data:blog.homepageUrl'> … </b:if>

Index Page Conditional Tags

New Verison
<b:if cond='data:view.isMultipleItems'> … </b:if>
Old Version
<b:if cond='data:blog.pageType == "index"'> … </b:if>

Item Page Conditional Tags

New Version
<b:if cond='data:view.isSingleItem'> … </b:if>
Old Version
<b:if cond='data:blog.pageType in ["item", "static_page"]'> … </b:if>

Post Page Conditional Tags

New Version
<b:if cond='data:view.isPost'> … </b:if>
Old Version
<b:if cond='data:blog.pageType == "item"'> … </b:if>

Static Page Conditional Tags

New Version
<b:if cond='data:view.isPage'> … </b:if>
Old Version
<b:if cond='data:blog.pageType == "static_page"'> … </b:if>

Label page Conditional Tags

New Version
<b:if cond='data:view.isLabelSearch'> … </b:if>
Old Version
<b:if cond='data:blog.searchLabel'> … </b:if>

Archive Page Conditional Tags

New Version
<b:if cond='data:view.isArchive'> … </b:if>
Old Version
<b:if cond='data:blog.pageType == "archive"'> … </b:if>

Search Page Conditional Tags

New Version
<!-- Includes Label Search Page -->
<b:if cond='data:view.isSearch'> … </b:if>

<!-- Search Page Only -->
<b:if cond='data:view.isSearch and !data:view.isLabelSearch'> … </b:if>
Old Version
<b:if cond='data:blog.searchQuery'> … </b:if>

Error / Error 404 Page Conditional Tags

New Version
<b:if cond='data:view.isError'> … </b:if>
Old Version
<b:if cond='data:blog.pageType == "error_page"'> … </b:if>

Preview Page Conditional Tags

New Version
<b:if cond='data:view.isPreview'> … </b:if>
Old Version
<!-- Nothing Here -->

Mobile Only Page Conditional Tags

New Version
<b:if cond='data:view.isMobile'> … </b:if>
Old Version
<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'> … </b:if>

Use of Conditional Tags

For use of the latest version of the conditional tag above, you can use it in HTML or widgets in the blogger theme.  Examples like this:


<b:if cond='data:view.isMobile'>

// html atau widget disini

</b:if>

To hide a page from certain conditional tags, put "exclamation mark" or "not" before data:view


<b:if cond='!data:view.isMobile'>

// html atau widget disini

</b:if>
Or
<b:if cond='not data:view.isMobile'>

// html atau widget disini

</b:if>

That's all from Blog Faters, thank you and wassalam.

Words can inspire, thoughts can provoke, but only action truly brings you closer to your dreams.

Post a Comment

© Blog Faters. All rights reserved. Developed by Jago Desain