: 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
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 -->
More posts by @Shanna517
3 Comments
Sorted by latest first Latest Oldest Best
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.
You can also check your microdata format against Google Webmaster Tools, rich snippet testing tool at www.google.com/webmasters/tools/richsnippets
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.