Currently the hCard / plain format system is unwieldy and unnecessary. An example is provided below:

The current system outputs the following:

<div class="vcard">
  <dl class="adr">
    <span class="fn org"><em>Organization name</em></span><br/>
    <dt>Street: </dt><dd class="street-address">3841 Nowhere Ln</dd><br/>
    <dt>City: </dt><dd class="city locality">Some city</dd>, 
    <dt>Province: </dt><dd class="region">California</dd> 
    <dt>Postal Code: </dt><dd class="postal-code">92542</dd><br/>
    <dt>Country: </dt><dd class="country-name">United States</dd>
  </dl>
</div>

When instead it should be output as:

<div class="vcard">
  <div class="fn org">Organization name</div>
  <div class="adr">
    <div class="street-address">3841 Nowhere Ln</div>
    <div>
      <span class="locality">California</span>,
      <span class="region">California</span> 
      <span class="postal-code">92542</span>
    </div>
    <div class="country-name">United States</div>
  </div>
</div>

This will allow a valid hCard format that does not disrupt the display to the end user and also support intuitive styling via CSS. This will be a large task consisting of rewriting much of the formatting system but will prove to improve the quality of the module.

Comments

codycraven’s picture

Title: Unify hCard/plain formats it to singular format » Unify hCard/plain formats to singular format

As this update will be a major change to the system it will be released as Addresses 6.x-2.x so that users will not upgrade without reading possible changes that will need to be made due to modified Tokens.

Planned todo list:

  • Parsing system
    • Output fields placed on the same line wrapped in <span> while newlines will be broken with <div>
    • Apply hCard and adr valid classes to field wrappers
    • Leave out included commas and spaces if the field prior is emtpy
    • If a row is comprised of empty fields then leave out wrapping <div>
  • Remove Tokens for plain and hCard formats replacing with a single untagged format
  • Update all hook_address_format() implementations within country files to remove hCard tags and use correct Tokens
  • Clear stored variables matching addresses_format_*CountryCode* (see hook_address_format() storage) within addresses.install for update