I'm creating a simple (well, it was going to be simple before I decided to mark it up with Microdata) web page containing company contact information for a business with two offices. I'm using schema.org and LocalBusiness for the two offices.
Here are the relevant parts of my HTML:
<body itemscope itemtype="http://schema.org/Corporation">
<header>
<hgroup>
<h1>Company Name</h1>
<h2 itemprop="description">Company description</h2>
</hgroup>
</header>
<section>
<h1><span itemprop="name">Company Name Limited</span> Offices</h1>
<article itemscope itemtype="http://schema.org/LocalBusiness">
<h2 itemprop="name">Company Name, Location 1 Office</h2>
<p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Street Address</span><br />
<span itemprop="addressLocality">Locality</span><br />
<span itemprop="addressRegion">Region</span><br />
<span itemprop="postalCode">Postcode</span><br />
<span itemprop="addressCountry">Country</span>
</p>
<p><a itemprop="maps" href="http://maps.google.co.uk/blahblah">Map</a></p>
<p>Telephone: <span itemprop="telephone">01234 567890</span><br />
Fax: <span itemprop="faxNumber">01234 567890</span><br />
Email: <span itemprop="email">[email protected]</span><br />
<a href="http://www.domain.co.uk" itemprop="url">http://www.domain.co.uk</a></p>
<!-- itemprop="branchOf" -->
</article>
<article itemscope itemtype="http://schema.org/LocalBusiness">
<h2 itemprop="name">Company Name, Location 2 Office</h2>
<p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Street Address</span><br />
<span itemprop="addressLocality">Locality</span><br />
<span itemprop="addressRegion">Region</span><br />
<span itemprop="postalCode">Postcode</span><br />
<span itemprop="addressCountry">Country</span>
</p>
<p><a itemprop="maps" href="http://maps.google.co.uk/blahblah">Map</a></p>
<p>Telephone: <span itemprop="telephone">01234 567890</span><br />
Fax: <span itemprop="faxNumber">01234 567890</span><br />
Email: <span itemprop="email">[email protected]</span><br />
<a href="http://www.domain.co.uk" itemprop="url">http://www.domain.co.uk</a></p>
<!-- itemprop="branchOf" -->
</article>
</section>
</body>
Where I currently have <!-- itemprop="branchOf" -->
, I believe I need to associate the LocalBusiness
es with the Corporation
mentioned earlier in the page.
How should I do this? Can an element id be used for this?
Thanks.
Schema.org (often called schema) is a semantic vocabulary of tags (or microdata) that you can add to your HTML to improve the way search engines read and represent your page in SERPs.
Microdata is part of the WHATWG HTML Standard and is used to nest metadata within existing content on web pages. Search engines and web crawlers can extract and process microdata from a web page and use it to provide a richer browsing experience for users.
The itemprop global attribute is used to add properties to an item. Every HTML element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. Each name-value pair is called a property, and a group of one or more properties forms an item.
This is possible with the use of the itemref
attribute:
itemprop="branchOf"
to the body
id
to the body
, e.g. id="foo"
itemref="foo"
to both article
Reduced example:
<body id="foo" itemprop="branchOf" itemscope itemtype="http://schema.org/Corporation">
<span itemprop="name">Company Name Limited</span>
<article itemscope itemtype="http://schema.org/LocalBusiness" itemref="foo">
<span itemprop="name">Company Name, Location 1 Office</span>
</article>
<article itemscope itemtype="http://schema.org/LocalBusiness" itemref="foo">
<span itemprop="name">Company Name, Location 2 Office</span>
</article>
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With