Blogger users come across situations like customising their Blog templates for adding various plugins or custom changes. So for doing this, they should be aware of various page types and how to identify that using blogger specific conditional statements.
various types of blogspot pages are Item, Statis, Index, Archive, Search Label etc
to get the page type you have to use the parameter "data:blog.pageType"
How to check an Archive type Page?
Here the "data:blog.pageType" will be "archive"
do it like this:
<b:if cond='data:blog.pageType == "archive"'>
<!--Archive Page-->
</b:if>
How to check index page?
Search page, label page and home page of the blog comes under "index" type
So here is how it is checked:
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--Search Page-->
</b:if>
<b:if cond='data:blog.searchLabel'>
<!--Label Page-->
</b:if>
<b:if cond='data:blog.searchQuery == ""'>
<b:if cond='data:blog.searchLabel == ""'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!--Homepage-->
<b:else/>
<!--Index Page-->
</b:if>
</b:if>
</b:if>
</b:if>
How to Check the Item page?
Item page means the detailed posting page. This is the page that you view after clicking on a "Continue reading" or "read more" link on home/label/search page
Item page is check like this:
<b:if cond='data:blog.pageType == "item"'>
<!--Item Page-->
</b:if>
How to check a static type Page?
Static pages are stand alone pages, like sitemap, contact us page etc you can check it using follow statement
<b:if cond='data:blog.pageType == "static_page"'>
<!--Static Page-->
</b:if>
Consolidated Page type checking code for blogger templates
Given below is the Consolidated Page type checking code
<b:if cond='data:blog.pageType == "archive"'>
<!--Archive Page-->
</b:if>
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--Search Page-->
</b:if>
<b:if cond='data:blog.searchLabel'>
<!--Label Page-->
</b:if>
<b:if cond='data:blog.searchQuery == ""'>
<b:if cond='data:blog.searchLabel == ""'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!--Homepage-->
<b:else/>
<!--Index Page-->
</b:if>
</b:if>
</b:if>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<!--Item Page-->
</b:if>
<b:if cond='data:blog.pageType == "static_page"'>
<!--Static Page-->
</b:if>
Above given steps will be helpful for those why try to implement changes in templates, like adding Adsense codes seperately in various pages and lots more funny things :)
Hope this helps:)
various types of blogspot pages are Item, Statis, Index, Archive, Search Label etc
to get the page type you have to use the parameter "data:blog.pageType"
How to check an Archive type Page?
Here the "data:blog.pageType" will be "archive"
do it like this:
<b:if cond='data:blog.pageType == "archive"'>
<!--Archive Page-->
</b:if>
How to check index page?
Search page, label page and home page of the blog comes under "index" type
So here is how it is checked:
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--Search Page-->
</b:if>
<b:if cond='data:blog.searchLabel'>
<!--Label Page-->
</b:if>
<b:if cond='data:blog.searchQuery == ""'>
<b:if cond='data:blog.searchLabel == ""'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!--Homepage-->
<b:else/>
<!--Index Page-->
</b:if>
</b:if>
</b:if>
</b:if>
How to Check the Item page?
Item page means the detailed posting page. This is the page that you view after clicking on a "Continue reading" or "read more" link on home/label/search page
Item page is check like this:
<b:if cond='data:blog.pageType == "item"'>
<!--Item Page-->
</b:if>
How to check a static type Page?
Static pages are stand alone pages, like sitemap, contact us page etc you can check it using follow statement
<b:if cond='data:blog.pageType == "static_page"'>
<!--Static Page-->
</b:if>
Consolidated Page type checking code for blogger templates
Given below is the Consolidated Page type checking code
<b:if cond='data:blog.pageType == "archive"'>
<!--Archive Page-->
</b:if>
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--Search Page-->
</b:if>
<b:if cond='data:blog.searchLabel'>
<!--Label Page-->
</b:if>
<b:if cond='data:blog.searchQuery == ""'>
<b:if cond='data:blog.searchLabel == ""'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!--Homepage-->
<b:else/>
<!--Index Page-->
</b:if>
</b:if>
</b:if>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<!--Item Page-->
</b:if>
<b:if cond='data:blog.pageType == "static_page"'>
<!--Static Page-->
</b:if>
Above given steps will be helpful for those why try to implement changes in templates, like adding Adsense codes seperately in various pages and lots more funny things :)
Hope this helps:)
Comments
Post a Comment