2

So I’m trying to mark up some structured data using a combination of the contact vCard Microformat and Microdata using Schema.org’s Place type.

I’d love to do both at once, but I have a problem that I don’t know whether the Schema.org Microdata examples require exact duplication of HTML, or whether they’re entirely reliant on the attributes that they suggest. Does anyone familiar with using Microdata know whether the structure of the HTML is important to the schema?

Here is my current HTML attempt just as an example if it helps clarify (with PHP variables escaped out into the HTML):

<div id='contact'>
  <h4 class='title' style='text-align:center;margin-top:1em'>Main Contact Info</h4>
  <div style='margin:0 1em;border:1px solid grey;padding:1em;width:45%' id="hcard-Sherman-Brothers" class="vcard" itemscope itemtype="http://schema.org/LocalBusiness">
         <div class="org" itemprop="name">
            ShermanBrothers in <?php h($row_rsLocation['City']);?>
         </div>
         <address class="adr" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" style='display:block'>
          <div itemprop="streetAddress" class="street-address">
          <?php echo $row_rsLocation['Address1'];
          if (!empty($row_rsLocation['Address2'])) {
                    echo '<br>'.$row_rsLocation['Address2'];
                }
         ?>

          </div>
          <span class="locality" itemprop="addressLocality"><?php h($row_rsLocation['City']);?></span>, 
          <span class="region" itemprop="addressRegion"><?php h($row_rsLocation['State']);?></span>, 
          <span class="postal-code"><?php h($row_rsLocation['ZipCode']);?></span>

          <span class="country-name">USA</span>

         </address>
         <a itemprop="telephone" href='tel:<?php h($row_rsLocation['Phone']);?>' class="tel"><?php h($row_rsLocation['Phone']);?></a>
      </div><!-- End of vcard class -->
    </div><!-- End of contact div -->
3

No, you don't need to duplicate the HTML exactly: microdata schemas are based on the microdata attributes. It doesn't matter (usually; e.g. links are an exception) what HTML tag those attributes are applied to.

You may want to start by reading "Getting started with schema.org", if you haven't already.

4

You can also check your microdata format against Google Webmaster Tools, rich snippet testing tool at http://www.google.com/webmasters/tools/richsnippets

-3

Yup, they need exact duplication as mentioned in http://schema.org/Place. It is fine if you've other html representation of the same data on the same page, but you need exact duplication of HTML as mentioned in http://schema.org/Place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.