Skip to main content

How to check Page Types in blogger templates for customizing blog pages

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:)

Comments

Popular posts from this blog

Payback Points - How to redeem - How to merge multiple payback accounts - Block Payback card - Payback customer care

Your SBI Debit card ending with XX0000 is deactivated only for Internet txn.

SBI account holders may have received an SMS with following message, supposed to be from State Bank of India (SBI).

Your SBI Debit card ending with XX0000  is deactivated only for Internet txn. To activate send SMS "SWON ECOM 0000" to 09223966666. No change for ATM/POS usage
** Replace the four Zeros with last 4 digits of your debit card number

Recently many of the SBI account holder has losed their money due to a hi-tech ATM robbery which happened in Thiruvananthapuram, capital city of Kerala.

Joomla and Forum Integration - Integrating Forums to Joomla

Joomla is one of the most popular CMS opensource packages. It is very easier to develop website's using Joomla. You just need to download Joomla package from Joomla's Official website www.joomla.org  and install it on your domain and later adding customizations to templates and feature and Your website is ready :). Now a days most websites provides a forum section for it users for discussing various article topics, gathering opinions etc.



Following are some best know forum opensource packages which can be integrated with Joomla and create a new forum experience for users


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog