I humbly propose that the Blogger pageType attribute be expanded to include label, print, homepage, search and all values. Right now it only supports item, archive and index values. I also propose that pageType be brought back as an attribute of the WIDGET tag.
Accepted Values For pageType
- archive: The user is browsing through past entries.
- index: The user is on the homepage or browsing through search results.
- item: Individual blog posts.
Using values other than the above will result in the page element not being displayed.
Possibly Depreciated Values
- all: Page element will not be displayed.
- main: Same as above
The two values above are referenced in Blogger Help under Page Elements Tags for Layouts. This page is clearly out of date (e.g., it lists pageType as an attribute of the WIDGET tag but in reality the pageType attribute is stripped from the WIDGET tag when saving your layout).
label pageType Value Proposal
Right now when you click on a label it runs a search query in the form of http://BLOGDOMAIN/search/label/LABELNAME and displays the results 20 posts at a time. There sort of exists code to check if the user is browsing this page:
<b:if cond='data:blog.url == data:label.url'>
That code only works within the confines of the Blog and Label widget types, thus limiting it's usefulness. It works as expected for the first page of results; however, when the user goes to the next page it stops working because the URL no longer matches with http://BLOGDOMAIN/search/label/LABELNAME.
A proper label value would fix the bug above with the bonus of being able to check for it from any widget type. This could really open up a whole new world of functionality.
print pageType Value Proposal
A print value would allow us the ability to transform the page and make it more presentable for printing. It would be up to template designers to take advantage of this value. A suggestion would be to have the print value function similarly to the old-style comments page. The difference would be that designers still have control over what happens on that other page—unlike the old style comments.
homepage Value And pageType Attribute For WIDGET Tag Proposal
Right now if I want something to appear only on the home page I use some variation of the code below (emphasis on 4th line):
<!-- SmoothGallery v2.0 --><b:widget id='HTML1' locked='true' title='SmoothGallery v2.0' type='HTML'><b:includable id='main'><b:if cond='data:blog.url == data:blog.homepageUrl'><div class='widget-content'><data:content/></div></b:if></b:includable></b:widget>
The result is a widget that only displays on the home page; however, when you examine the source from anywhere outside the home page you see this:
<div class="widget HTML" id="HTML1"></div>
That empty DIV is a major problem because now we have to figure out a CSS workaround for whether the content is displayed or not. Having to code a workaround actually limits our range styling options. If pageType was an attribute of the WIDGET tag we'd no longer have have empty DIVs and thus could style the widgets the way we originally intended. A homepage value for the pageType attribute would ensure that a page element only appears on the home page; there currently exists no equivalent.
search pageType Value Proposal
The index value indicates when the user is on a page that starts with http://BLOGDOMAIN/search. It also indicates that the user is on the homepage or is browsing through older/newer pages from the homepage. Thus, there's doesn't exist a way to tell the difference between browsing and searching. I tried using the following condition to determine if a search was performed:
Unfortunately 'navMessage' is a variable exclusive to the Blog widget; meanwhile, the search term itself is obfuscated by surrounding text. With a search pageType we'd be able to determine from the vantage point of any widget if the user has triggered a search. And with a variable for the actual search term we'd know what exactly the user was looking for. Having these tools at their disposal will empower template designers to forge a more comprehensive search page.
It should be noted that 'navMessage' still works even if the search results span multiple pages—including labels.
all Value Proposal
If the pageType attribute is being used on a page element which you've decided should appear on all pages you'll have to either deleted or comment out the following two lines:
<b:if cond='data:blog.pageType != "archive"'></b:if>
Having all would make this a simple matter of changing the pageType value. There's no need for a hide value at the current time because typing anything other than accepted pageType values prevents the page element from displaying.
While I sometimes wish Blogger had a richer feature set—post summaries, post categories, post thumbnails, the inclusion of || and && for conditions—implementing such ideas requires more time and research. The goal of this proposal is to simply iterate on already existing functions of the Blogger template system. I hope this isn't asking for too much. It is my belief that Blogger is the BEST free blogging platform on the Internet and with these proposed iterations it can only get better.
To clarify I'm not proposing that pageType be moved to the WIDGETS tag, I'm proposing that pageType be added to the WIDGETS tag.
How To Raise Awareness
Go to Page Elements Tags for Layouts, scroll down and select "No." This page has many inaccuracies (e.g., it says to lock a widget the Locked attribute must equal yes, that doesn't work: the value must equal true). Once should should be sufficient.
Go to the Blogger Wishlist, click on "Have more template options", paste the permalink of this blog entry into the form field and post a brief message explaining why you think this is important.
Link to this post on your blog and relevant social bookmarking sites. If you're skeptical and think this is some elaborate scheme to raise my PageRank score then go right ahead and "nofollow" the link. The spread of information is my only concern.