view
data here as I am always asked via email by my followers & blog subscribers on other options that Blogger provides in customizing their blog template views.These
view
data sets is available in any Blogger theme. At a Blogger page > Right Click
> select Inspect
> scroll to the very bottom of view-source
under _WidgetManager._SetDataContext()
Blogger settings objects.Behavior
Available globally in Theme > Edit HTML. Some data
view
object values depends on the availability of Mobile Template view settings at Theme > Mobile Template > Settings.These data
view
objects also combines Dynamic Theme template settings when it is enabled/used.{ 'name': 'view', 'data': { 'isMobile': boolean, 'title': text, /* blog page title */ 'description': text, /* blog page search description */ 'featuredImage': url, /* fully qualified post image URL */ 'url': url, /* fully qualified blog page canonical URL */ 'type': pageType, /* item, index, static_page etc */ 'isSingleItem': boolean, 'isMultipleItems': boolean, 'isError': boolean, 'isPage': boolean, 'isPost': boolean, 'isHomepage': boolean, 'isArchive': boolean, 'isLabelSearch': boolean, 'postId': integer, /* blog post id */ 'isPreview': boolean, 'isMultipleItems' : boolean, 'isSingleItem' : boolean, 'isArchive' : boolean, 'isLabelSearch' : boolean, 'isSearch' : boolean, 'isLabelSearch' : boolean } }
How to use on Blogger Theme > Edit HTML
These data
view
can be used with any Blogger expression tags. Example usages :-<!-- check title data availability in view data object --> <b:if cond='data:view.title'> <!-- print out the title data values with a <h1/> tag --> <h1><data:view.title /></h1> </b:if>
Example Output
A blog page title with an
<h1>
tag.Resources
- Widget Tags for Layout - Blogger Help Articles
- Adding new expressions to Blogger templates - Official Blogger Blog
Notes
If I have left something out or possible new updates by Blogger Team, please leave a comment below.
For the first time I have changed the theme that are meant to be the part of the using this phone. It has been so interesting and new for me to change the theme whenever I want to.
ReplyDelete