MY STADY

View Original

The Complete Guide to All Blogger Page Types (2019)

UPDATE 19 JAN 2019: I already know what you’re thinking. ‘Why is this amazing Blogger hacking guide hosted on Squarespace?’ Great question! For the past ten years this blog was hosted at Blogger. During my stay I was a very active Blogger developer. Even though I don’t use Blogger anymore I still want to give back to the community I called home for the past ten years.

For returning developers (and those filthy web scrapers who keep stealing this), I’ve re-written and updated this guide. It should read a lot better now. The old guide reads like Mojo Jojo wrote it. I don’t know why I was so verbose before. I also replaced the graphical tables (data matrix) with markup. I should have used semantic markup in the first place. I guess that’ll also make it easier for those damn web scrapers to copy the updated version. Did I forget to mention I constantly find rogue copies of this guide on other blogs? If you’re gonna use this to write another guide at least give me credit, please? Thank you.

I’ve finally added a section on error pages. That was often requested and I finally got around to it. Sorry for the delay. That brings our total number of page types from seven to eight. I can’t imagine they’ll be adding more but if they do let me know in the comments and I’ll update this guide.

Cheers!


If you've only been using the pageType tag to identify the page types then you’ve seriously been limiting your potential. That data tag only returns five unique values but the total number of page types is eight. This guide will teach you how to identify all eight of Blogger’s page types. If you’re not family with the terminology consult the glossary section. If that still doesn't help leave me comments. I understand the terminology in this document could be confusing at first. But you’ll pick it up in no time!

The code snippets in this guide are the absolute least amount of code required to get the task done. Blogger’s template engine has seen a revision so I’ve updated my snippets to match. They’ve all been tested to work as of this update.

See also: Printer Friendly Posts for Blogger Made Easy! (Update)

blogger2ools

This data was collected using my blogger2ools project. It’s a Blogger developer template designed to exposes all the underlying code and data tags in realtime. So as you navigate the blog you can see how the variables change from page to page. It’s an excellent tool for advanced Blogger developers out there and it’s been instrumental in helping me put this guide together.

Contents


See this content in the original post

See this content in the original post
Item Page Type Data Matrix
Data Tag Result
blog.title (blog title)
blog.pageTitle (blog title): (blog post title)
blog.pageName (blog post title)
blog.pageType item
blog.searchLabel
blog.searchQuery
blog.url (homepage URL)YYYY/MM/(permalink)
blog.homepageUrl (homepage URL)

This code snippet will identify item pages:

See this content in the original post

See this content in the original post
Static Page Type Data Matrix
Data Tag Result
blog.title (blog title)
blog.pageTitle (blog title): (static page title)
blog.pageName (static page title)
blog.pageType static_page
blog.searchLabel
blog.searchQuery
blog.url (homepage URL)p/(permalink)
blog.homepageUrl (homepage URL)

This code snippet will identify static pages:

See this content in the original post

See this content in the original post

This code snippet will identify archive page types but keep those caveats in mind. Hmm, are they caveats or bugs? Makes you think…

See this content in the original post

See this content in the original post

The code for error pages is straightforward.

See this content in the original post

See this content in the original post

This code snippet will let you know you’re on the homepage.

See this content in the original post

See this content in the original post

Here’s my code snippet for search pages. It’s been factored down from before and now uses two less lines!

See this content in the original post

See this content in the original post

Here’s the label code. It’s also been refactored.

See this content in the original post

See this content in the original post

Here’s the code for finding index pages. As you can see it’s just trying to eliminate all other possibilities.

See this content in the original post

See this content in the original post

Changelog

Oct-25 2018

  • Added the error page type.

  • Refactored search code snippet.

  • Refactored label code snippet.

  • Refactored index code snippet

  • Refactored the code snippet that detects all the page types.

  • Data matrix changed from spreadsheet screenshots to HTML tables.

May-22 2011

  • Initial Release.