Don't worry in this article I am going to tell you all about views and page types in blogger blog. There are different page types in blogger that can be e classified into different categories.
In WordPress, you have multiple plugins to do so but in blogger, you don't have any solution for this other than determining the page types.
Page types in blogger are inside the data object and you can find the page type by data:blog.pageType, it will return the page type of blogger blog and data:view.type will return the view type of blogger blog,
Below is the list of page types that are used in blogger and the return value of data:blog.pageType & data:view.type.
Page types in blogger:
|data:view.isHomepage||Specifies the homepage of blogger blog.|
|data:view.isPost||Specifies the posts or articles pages, posts that you publish.|
|data:view.isPage||Specifies the pages in blogger, not posts.|
|data:view.isError||Specifies the error page.|
|data:view.isArchive||Specifies the archive page of your blogger blog where all the posts of your blog are listed.|
|data:view.isLabelSearch||Specifies whether the page is search by label or not.|
|data:view.isMultipleItems||This specifies the multiple item pages in blogger like search pages, archive pages, homepage and all the other pages other than posts and pages in blogger.|
|data:view.isSingleItem||Determines whether the page is a single item page like post page or page.|
|data:view.isMobile||Specifies whether the client device is mobile or not.|
|data:view.isPreview||Determines if your website is in preview mode especially when you are writing an article and previewing it before publishing.|
|data:view.isLayoutMode||Determine the layout mode of your blogger blog. Layout mode is the mode of your blogger dashboard where you can add or remove widgets.|
keep one thing in mind that the value of all the above commands will be boolean ( true or false ) which means that you can use all of them as conditions.All the above commands are universal which means that they can be used anywhere inside your bloggers XML code.
Example usage of all the above commands:This is the example code that specifies how you can use the above commands in blogger XML code and take all of them into action. You can use all of the above commands as a condition and now it's up to you whether you use that with b:if, b:eval or a tag itself.
<!-- Usage with b:eval --> <b:eval expr='data:view.isHomepage'/> <!-- Usage with b:if --> <b:if cond='data:view.isHomepage'> <!-- Code to be executed --> </b:if> <!-- Usage by tag itself --> <data:view.isHomepage/>
Wind Up:A list of all the commands that can be used to determine the page types and views of blogger blog are listed above.
You can use any of the commands in your blogger XML code globally at any place and get the result but keep one thing in mind the result will be a Boolean value.
I hope that you will feel this article informative and if you want anything else, comment it down I will be very much excited to answer it.