Thursday, March 22, 2007

Valid XHTML - the layout tags

pencil icon, that"s clickable to start editing the post

A problem with the layout tags are that some of the scalars (attributes or functions) that produces URL's and some of these af not valid XHTML because of the Ampersands (&'s) in URLs, an example is in the BlogArchive widget:

<a class='post-count-link' expr:href='data:i.url'>
   < />
which produces URL's like
  • updated-min=2007-01-01T00%3A00%3A00%2B01%3A00
  • updated-max=2008-01-01T00%3A00%3A00%2B01%3A00
  • max-results=12
the variable i comes from this loop:
<b:loop values='data:intervalData' var='i'>
so the intervalData is of a collection or array type. This loop is part of an includable template component where the intervalData is defined:
<b:includable id='interval' var='intervalData'>
described in Widget Tags for Layouts. This is included when using HIERARCHY for blog archive
<b:if cond='data:style == "HIERARCHY"'>
   <b:include data='data' name='interval' />
so the variable data (used as intervalData) is transfered to the includable template component. This finally is part of the widget of type BlogArchive
<b:widget id='BlogArchive1'
          title='Blog Archive'
So the data (confusing enough not prefixed) must be globally available in this widget. In the Layouts Data Tags has a description of the data available to the Blog Archive:

The different styles provided here are for the different default options on the Page Elements tab. If you're designing a new version, it's easiest to use 'FLAT' as the style, and then manipulate the rest of the data as desired.

  • title: The title of the widget.
  • style: One of 'MENU', 'FLAT', or 'HIERARCHY'.
  • data: A list of each archive unit, each of which contains:
    • name: The name of this archive interval, e.g. "August 2006."
    • url: The link to the page containing posts from this interval.
    • post-count: How many posts there are in this interval.
I hope it's possible to access the start og end date (year or month).
ecmanaut - Blogger beta templates


Dani Iswara said...

nice posts of valid xhtml topics..
→ so it is more difficult to make blogspot layouts valid xhtml..[sigh]..
I made it valid xhtml 1.1 on Dani Iswara Weblog..web standards dreaming..

Sweetxml said...

Thanks Dani and congrats on your success with the classic template. I haven't had time/energy to look into again.
I just had a quick look at some of your posts and it seems like your third article on the template walk through is about the same subject (and more). With this snippet it looks like Google did a better job with the classic template tags than with the new ones. Someone in the help groups mentioned that at a time it was valid but for some unknown reason they changed it (can't recall the post right now, so no link).
In your template listing i guess that this part is the same - sorry the way it looks but I now realize that very few tags are allowed in comments:

<h2 class="sidebar-title">
<ul class="archive-list">
<a href="<$BlogArchiveURL$>" title="<$BlogArchiveName$>">

dani iswara said...

Thank you..
• Waiting for your layout validation..keep trying..
Since I'm not a web designer or web developer :D, but I do respect on a web standard..

• I'll remember for that issue if it happen to my blog..thanks..

• agree on the tags :D