SMsudipBD.Com
Published:
Comments:
4
![]() |
| Blogger / Blogspot Conditional Tag For Different Page Type |
<b:if cond="condition_expression">
<!--content when condition is satisfied-->
</b:if>
<b:if cond='data:blog.pageType == "archive"'>
<!--archive_Page-->
</b:if>
<b:if cond='data:blog.pageType == "error_page"'>
<!-- all error pages-->
</b:if>
<b:if cond='data:blog.pageType == "index"'>
<!-- all index pages -->
</b:if>
Homepage<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only homepage -->
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<!-- all item pages -->
</b:if>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "2014/08/foo.html"'>
<!-- a item page from august 2014 with post-title 'foo'-->
</b:if>
<b:if cond='data:blog.searchLabel'>
<!-- all label pages -->
</b:if>
<b:if cond='data:blog.searchLabel == "foo"'>
<!-- for label 'foo' -->
</b:if>
<b:if cond='data:blog.searchQuery'>
<!-- all search pages -->
</b:if>
<b:if cond='data:blog.searchQuery == "foo"'>
<!-- for query 'foo' -->
</b:if>
<b:if cond='data:blog.pageType == "static_page"'>
<!-- all static pages -->
</b:if>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/foo.html"'>
<!-- a specific static page with name 'foo' -->
</b:if>
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/foo.html"'>
<!-- static_site foo OR static_site bar -->
<b:else/>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/bar.htm"'>
<!-- static_site foo OR static_site bar -->
</b:if>
</b:if>
<b:if cond='data:blog.pageType != "item"'>
<!-- all pages except item pages -->
</b:if>
<b:if cond='data:blog.url != data:blog.homepageUrl'>
<!-- all pages but NOT homepage -->
</b:if>
<b:if cond='data:blog.pageType == "item"'>
# THIS CONTENT WILL BE EXECUTED IF CONDITION IS TRUE
</b:if>
<b:if cond='data:blog.pageType == "item"'>
# THIS CONTENT WILL BE EXECUTED IF CONDITION IS TRUE
# i.e. if current page is post (item) page
<b:else/>
# THIS CONTENT WILL BE EXECUTED IF CONDITION IS FALSE
# i.e. if not post page
</b:if> Download Links
Share
We noticed you're using an ad-blocker. Our content is free because of ads. Please support us by whitelisting our site.
4 comments