17 Mar 2021

Blogger data:blog.pageType | Help To Create Dynamic Page Under Blogger.

In this post l am going to share with you Blogger data:blog.pageType. if you are editing your Blogger template themes. Then this is the blogger data tag that may help you a lot to create more dynamic webpages.

Let assume a satution where you want to show a author widget under the post pages.
<b:if cond="data:blog.pageType == 'item'"> 

// HTML, CSS and JavaScript of your author widget. 

If you don't do conditional, the author widget will be shown all over Webpage type like index, homepage, static_page, error_page etc.

data:blog.pageType == item

The condition meets if current webpage type of a Blogger is an Post page.

data: blog.pageType == index

if current webpage is index page, a list of Post on Homepage. next & previous pagination if available then these are also a pageType of item.

data:blog.pageType. == "static_page"

if current pages is static page. Generally all the webpages which is under /p/ folder known as Page / Static Page.
/p/about.html is a type of page - static_page.

data:blog.pageType == error_page

it represent a website's webpage with an error. Like 404 page not found.

if you try to browse a link that doesn't exist in your Blogger blog posts & pages.
/example.html - it is Page with Error. Because it is not hosted under your blog main directory.


No comments:

No Comments