I'm revamping my work's Employee Directory, adding hCard
data to each employee's listing.
An issue I haven't been able to figure out is how to avoid duplicating information, such as organization-name
and organization-unit
.
Here's a trimmed-down example of my code:
<div id="hcard-business" class="vcard">
<div class="adr">
<div class="org fn"><a class="url" href="http://www.business.com/">Business</a></div>
<div class="street-address">123 Business Street</div>
<div>
<span class="locality">City</span>,
<abbr class="region" title="State">ST</abbr>,
<span class="postal-code">99999</span>,
<span class="country-name">USA</span></div>
</div>
</div>
</div>
<table class="contact">
<thead>
<tr><th colspan="4">Marketing Department</th></tr>
<tr class="head"><th>NAME</th><th>TITLE</th><th>PHONE</th><th>EMAIL</th></tr>
</thead>
<tbody>
<tr id="hcard-employee1" class="vcard odd">
<td class="fn">Employee Name</td>
<td class="title">Director</td>
<td class="tel">907-335-1243</td>
<td>
<a class="email" href="mailto:[email protected]">[email protected]</a>
<span class="org fn hidden">
<span class="organization-name">Business Name</span>,
<span class="organization-unit">Marketing</span>
</span>
</td>
</tr>
<tr id="hcard-employee2" class="vcard even">
<td class="fn">Employee Name</td>
<td class="title">Assistant</td>
<td class="tel">907-335-1243</td>
<td>
<a class="email" href="mailto:[email protected]">[email protected]</a>
<span class="org fn hidden">
<span class="organization-name">Business Name</span>,
<span class="organization-unit">Marketing</span>
</span>
</td>
</tr>
</tbody>
</table>
What I'm attempting to do is trim out the hidden
span from the last <td>
, grabbing organization-name
from the business' hCard
and organization-unit
from the <thead>
.
I've pretty much scoured microformats.org looking for an example of what I'm attempting, but no luck. I've even peeked at several of their "microformats in the wild" list, but the few sites I found there with multiple employee lists were using the same hidden
method with duplicate information that I've used in my example.
Is what I'm attempting to do even possible?