How to hCard company information?

1.3k Views Asked by At

I'm tying to markup some content semantically. The content is company information, which may have multiple addresses, multiple phone numbers, multiple email addresses.

The hCard generators that I see seems to expect a person's details (e.g. first name, last name, etc.).

Is there a way to markup just company details? If so, how?

Also, is hCard the correct format to use?

2

There are 2 best solutions below

7
albert On

you can use multiples of most microformats' properties, as long as you heed the parental element(s), so in your case, as long as all the multiple data properties are children of .vcard and not .vcard as well, all is good. actually threw this together from two of their examples on http://microformats.org. here you go:

  
<div id="contact" class="vcard">  
   <h2>Contact Me Yo!</h2>  
   <h3 class="fn">Jane Doe</h3>  
   <p>You can contact me via email to   
    <a class="email" href="mailto:[email protected]">[email protected]</a>,   
    or reach me at the following address:</p>  
   <div class="adr">  
     <span class="type">home</span> address:  
     <div class="street-address">123 Main Street</div>  
     <span class="locality">Any Town</span>, <span   class="region">CA</span>,   
     <span class="postal-code">91921-1234</span>  
   </div>  
   <div class="adr">  
     <span class="type">work</span> address:  
     <div class="street-address">789 Main Street</div>  
     <span class="locality">Any Town</span>, <span   class="region">CA</span>,   
     <span class="postal-code">91921-1234</span>  
   </div>  
</div>  

references:
http://microformats.org/wiki/hcard-faq#Can_you_have_multiple_value_elements
http://microformats.org/wiki/hcard-faq#How_do_I_markup_multiple_addresses

is hcard the correct format to use?
100% absolutely...microformats are part of the html5 spec, they are the most widely used semantic web technology, they fit your exact needs, and they are (currently) indexed by the major search engines. microformats add levels to your document that most refuse to believe, but all you have do to is follow instructions, and you've got a pre-baked api in your markup.

that said, google/bing/yahoo!/yandex (? the russian search engine), have all openly endorsed schema.org, and while they support microformats (have for years), you'd be a fool to think they won't give their method(s) incentive(s) to be used. i'm not aware of any that are entirely microformats vs. schema.org yet, but i'm sure they are on the way. at the moment, imo, its more about tying everything into g+ for google right now, so everything else is taking a backseat. which only speaks to my point(s)...

clearly i am biased, but that's about as clear and dry as i can be. i actually have the same mental debate for each and every client that puts me in the position to run wild with their markup...i have yet to break down and start using schema, however, i am quite prepared for them to ping me randomly, should google magically stop harvesting microformats.

0
Matthias Pfefferle On

To add company informations you have to simply add an org at the same level of the fn of your hCard.

Here is example:

<div class="vcard">
 <a class="url fn org" href="http://compa.ny">Company Name</a>
</div>

Or you can try it with Microdata/Schema.org which will be more supported by the great search engine providers: http://schema.org/Organization