[uf-discuss] hCards for places

Andy Mabbett andy at pigsonthewing.org.uk
Sun Dec 30 16:40:34 PST 2007


As I've noted on the wiki:

     <http://microformats.org/wiki/hcard-brainstorming#Named_locations>

the proposal to codify hCards for places by making the "fn" and the
"extended-address" the same, though elegant, does not work in all cases.

Consider an hCard for a City, "Birmingham, England": Birmingham may be
the "fn" and the "locality", but it's not an "extended-address".

Perhaps the rule should be that the hCard is for a place if the "fn" is
on *any* address ("adr") child-component [1] (e.g. "fn locality" or "fn
street-address")?

This would allow, for instance:


hCard for a small place:

        <foo class="vcard">
          <foo class="adr">
            <foo class="fn extended-address">
                Hyde Park
            </foo>
          </foo>
        </foo>


hCard for a small town or city:

        <foo class="vcard">
          <foo class="adr">
            <foo class="fn locality">
                Boston
            </foo>
          </foo>
        </foo>


hCard for a state or county:

        <foo class="vcard">
          <foo class="adr">
            <foo class="fn region">
                Texas
            </foo>
          </foo>
        </foo>


hCard for a country:

        <foo class="vcard">
          <foo class="adr">
            <foo class="fn country-name">
                England
            </foo>
          </foo>
        </foo>


and even an hCard for a stand-alone postal code:

        <foo class="vcard">
          <foo class="adr">
            <foo class="fn postal-code">
                B1 1AA
            </foo>
          </foo>
        </foo>


The rule would require the two class names to appear together on one
element, not merely that the values are the same; so, for example, if a
model called "India" lives in the country "India", these would be marked
up as separate attributes on two distinct elements:


        <foo class="vcard">
          <foo class="fn">
                India
          </foo>
          <foo class="adr">
            <foo class="country-name">
                India
            </foo>
          </foo>
        </foo>


[1] with the exception of "@type", of course!

-- 
Andy Mabbett


More information about the microformats-discuss mailing list