Mobile app version of vmapp.org
Login or Join
Shanna517

: Is the structure of the HTML (e.g., from Schema.org examples) important to Microdata? So I’m trying to mark up some structured data using a combination of the contact vCard Microformat and

@Shanna517

Posted in: #Html5 #Microdata #SchemaOrg

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 -->

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Shanna517

3 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

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.

10% popularity Vote Up Vote Down


 

@Annie201

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

10% popularity Vote Up Vote Down


 

@Chiappetta492

Yup, they need exact duplication as mentioned in 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 schema.org/Place.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme