Note that there are some explanatory texts on larger screens.

plurals
  1. POavoiding repeat data in hCard
    primarykey
    data
    text
    <p>I'm revamping my work's Employee Directory, adding <code>hCard</code> data to each employee's listing.</p> <p>An issue I haven't been able to figure out is how to avoid duplicating information, such as <code>organization-name</code> and <code>organization-unit</code>.</p> <p>Here's a trimmed-down example of my code:</p> <pre><code>&lt;div id="hcard-business" class="vcard"&gt; &lt;div class="adr"&gt; &lt;div class="org fn"&gt;&lt;a class="url" href="http://www.business.com/"&gt;Business&lt;/a&gt;&lt;/div&gt; &lt;div class="street-address"&gt;123 Business Street&lt;/div&gt; &lt;div&gt; &lt;span class="locality"&gt;City&lt;/span&gt;, &lt;abbr class="region" title="State"&gt;ST&lt;/abbr&gt;, &lt;span class="postal-code"&gt;99999&lt;/span&gt;, &lt;span class="country-name"&gt;USA&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;table class="contact"&gt; &lt;thead&gt; &lt;tr&gt;&lt;th colspan="4"&gt;Marketing Department&lt;/th&gt;&lt;/tr&gt; &lt;tr class="head"&gt;&lt;th&gt;NAME&lt;/th&gt;&lt;th&gt;TITLE&lt;/th&gt;&lt;th&gt;PHONE&lt;/th&gt;&lt;th&gt;EMAIL&lt;/th&gt;&lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr id="hcard-employee1" class="vcard odd"&gt; &lt;td class="fn"&gt;Employee Name&lt;/td&gt; &lt;td class="title"&gt;Director&lt;/td&gt; &lt;td class="tel"&gt;907-335-1243&lt;/td&gt; &lt;td&gt; &lt;a class="email" href="mailto:employee.name@business.com"&gt;employee.name@business.com&lt;/a&gt; &lt;span class="org fn hidden"&gt; &lt;span class="organization-name"&gt;Business Name&lt;/span&gt;, &lt;span class="organization-unit"&gt;Marketing&lt;/span&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id="hcard-employee2" class="vcard even"&gt; &lt;td class="fn"&gt;Employee Name&lt;/td&gt; &lt;td class="title"&gt;Assistant&lt;/td&gt; &lt;td class="tel"&gt;907-335-1243&lt;/td&gt; &lt;td&gt; &lt;a class="email" href="mailto:employee.name@business.com"&gt;employee.name@business.com&lt;/a&gt; &lt;span class="org fn hidden"&gt; &lt;span class="organization-name"&gt;Business Name&lt;/span&gt;, &lt;span class="organization-unit"&gt;Marketing&lt;/span&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>What I'm attempting to do is trim out the <code>hidden</code> span from the last <code>&lt;td&gt;</code>, grabbing <code>organization-name</code> from the business' <code>hCard</code> and <code>organization-unit</code> from the <code>&lt;thead&gt;</code>.</p> <p>I've pretty much scoured <a href="http://microformats.org" rel="nofollow">microformats.org</a> 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 <code>hidden</code> method with duplicate information that I've used in my example.</p> <p>Is what I'm attempting to do even possible?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload