Understanding Blogger Page Types

  • Sharebar

Understanding the various Blogger page types is important if you plan to edit your own Blogger template. When you know this, then you can display certain HTML elements on specific pages by checking the page type.

In my tutorials I, at times, mention creating conditional statements that check the type of page that is displayed. This is to ensure a particular code statement is executed only for a particular type of page. Let’s look at the different page types.

Blogger Page Types

blogger logo 370x368 300x298 Understanding Blogger Page Types

When I first started editing Blogger templates I went through some of the examples that were shown in the help system. While it does explain how the tags all come together, the help system is not comprehensive when it comes to examples.

There have been times when I wanted to only display certain elements on specific pages, such as post pages, or the homepage. To do this, I needed to understand how the page types worked within a Blogger template.

After reading the help, and checking the page types that they indicated existed, I tried editing my template to see if I could target specific pages. Sometimes the code in the template worked, while other times it wouldn’t.

I decided to then determine the page types that were associated with specific pages. To do this, I added the following code in my template:

<p><data:blog.pageType/></p>

After adding the above code, I viewed various pages in my Blogger blog and came up with the following page types:

PageType
Homepageindex
Postitem
Labelsindex
Archive – Yearindex
Archive – Montharchive

How Do I Use the Page Types?

By using the above tables, you can now place specific HTML code on specific pages. For example, to show HTML on a post page only, I would using the following code:

<b:if cond='data:blog.pageType == "item"'>
  <p>This sentence will only show on a post page.</p>
</b:if>

If you don’t want something to appear on the homepage, labels, or an archive year page, you would do something like:

<b:if cond='data:blog.pageType != "index"'>
  <p>This sentence will not show on the homepage, labels, or archive year page.</p>
</b:if>

If you want to display some text on the labels or archive year page only, but not the homepage, you would do something like this:

<b:if cond='data:blog.pageType == "index"'>
  <b:if cond='data:blog.url != data:blog.homepageUrl'>
    <p>This sentence will only show on the labels, or archive year page, but not the homepage.</p>
  </b:if>
</b:if>

As you can see, once you understand the different page types, you can customize the look of your various pages to your visitors, which can add much more appeal to your blog.

You may also like:

Blogger Logo

Hiding Static Pages from Main Page in Blogger

Blogger Logo

Display a Blog List as a Static Page in Blogger

No thumbnail image

Introducing Blogger to the Limit

Blogger Logo

Remove Navigation Links For Static Pages in Blogger

8 people had something to say about “Understanding Blogger Page Types”:

Comments


  1. I’m sure I’m not the only person who’ll notice the lack of a privacy policy page in the above list, especially now that Google seem to be requiring it from all their publishers.


    • Yep. The way most are implementing a privacy policy page on Blogger is to create a privacy policy post.


  2. I seriously believe that you need a tab or label or tag linking helpful links for blogger et. al.

    Thanks!


  3. I got a privacy policy on my blog. I’ve put one cause they say Google won’t pay you if you don’t have. But I don’t see any reason why google won’t pay cause of the privacy policy.


    • I know Google requires a privacy policy for AdSense, so it is a requirement for being paid. I think Google can hold your payment until you comply with their terms of service.


  4. i am getting page type issue while applying for an adsense account on my blog, http://www.artphotogallary.blogspot.com, and how to resolve this ??? can any one tell me please….


  5. i tried combining it with inbuilt blogger thumbnails feature. Configuring static pages took time but conditional ststements here helped. thanks!
    sonu recently posted…Linux Desktop Chooser – Use Linux OS that works for you!My Profile


  6. I am new to blogging and I currently learning on how to customize my page types and this one is serves as the very helpful one. Thanks!
    Anthony Walker recently posted…What is Mildew ?My Profile

Do you have something to say? Let everyone know!

Commenting policy: All comments are moderated for spam. You must use your real name and not your website name or keywords. If a comment is deemed to be spam, then it will be deleted or edited. Links to your website within the comment body is not permitted, but you are free to use CommentLuv to add a link to your latest post. If you wish to add a link to your website, you can always contact me about submitting a guest post.






CommentLuv badge
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 5 approved comments. Use your real name and then @ your keywords (maximum of 3)

Previous Post:

Next Post: