I have a page containing multiple Articles, I want each one to describe the Publisher as an Organisation, but what I'd like to avoid is redefining that Organisation for every single article. Is this possible?
The itemref attribute only seems to work in the opposite direction, specifying a parent > child relationship, not the other way around.
In this example I've taken the organisation example from Schema.org which I hope illustrates the problem - you can't repeat this markup every time, it would bloat the page.
<div itemscope itemtype="http://schema.org/Organization">
<span itemprop="name">Google.org (GOOG)</span>
Contact Details:
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
Main address:
<span itemprop="streetAddress">38 avenue de l'Opera</span>
<span itemprop="postalCode">F-75002</span>
<span itemprop="addressLocality">Paris, France</span>
,
</div>
Tel:<span itemprop="telephone">( 33 1) 42 68 53 00 </span>,
Fax:<span itemprop="faxNumber">( 33 1) 42 68 53 01 </span>,
E-mail: <span itemprop="email">secretariat(at)google.org</span>
Members:
- National Scientific Members in 100 countries and territories: Country1, Country2, ...
- Scientific Union Members, 30 organizations listed in this Yearbook:
List of Alumni:
<span itemprop="alumni" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Jack Dan</span>
</span>,
<span itemprop="alumni" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">John Smith</span>
</span>
</div>
<div itemscope itemtype="http://schema.org/NewsArticle">
<meta itemprop="url" content="{{canonical_url}}" />
<link itemprop="mainEntityOfPage" href="{{canonical_url}}">
<meta itemprop="genre" content="{{genre}}" />
<meta itemprop="publisher" temtype="http://schema.org/Organization" content="{{???}}" />
<meta itemprop="dateModified" content="{{updated_at}}" />
<div class="item-content">
<div class="item-header" itemprop="name headline">
{{Headline}}
</div>
<div class="item-body">
<p itemprop="articleBody">
{{content goes here}}
</p>
</div>
<div class="item-footer">
<span itemprop="datePublished dateCreated">{{date}}</span> - <span itemprop="creator author copyrightHolder">{{byline}}</span>
</div>
</div>
</div>
I'm currently using microdata but if what I'm attempting is possible with JSON then I would consider switching.
If you have an Organization item and several Article items on the same page, you can use Microdata’s itemref attribute to provide the Organization item as value for the publisher property:
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization" id="publisher-1">
</div>
<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>
<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>
<article itemscope itemtype="http://schema.org/Article" itemref="publisher-1">
</article>
If using this, you have to make sure that the div (for the Organization item) is not a child element of another element with itemscope (otherwise it would be added to this item as publisher in addition).
Related
I tried a simple example, but the SiteNavigationElement is not working when I test it using the Google Structured Data Testing Tool. It gives the error:
SiteNavigationElement is not a known valid target type for the additionalType property.
The Microdata:
<div itemscope itemtype="http://schema.org/WebPageElement">
<link itemprop="additionalType" href="http://schema.org/ItemList" />
<meta itemprop="name" content="navigation_menu" />
<ul>
<li itemprop="additionalType" itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span itemprop="itemListElement">
<a href="http://www.example.com/link_1" itemprop="url">
<span itemprop="name">Link 1</span>
</a>
</span>
</li>
<li itemprop="additionalType" itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span itemprop="itemListElement">
<a href="http://www.example.com/link_2" itemprop="url">
<span itemprop="name">Link 2</span>
</a>
</span>
</li>
</ul>
</div>
The additionalType property should not be used to create another item (which you are doing with itemscope+itemtype). Its job is to provide the URI of additional types, so the URI itself is the value here.
It seems that you want to mark up each link in your navigation. This is not possible with SiteNavigationElement (it can only be used to mark up the whole navigation, so it’s typically useless).
It would be possible with ItemList, and you could provide SiteNavigationElement as additionalType (but I wouldn’t expect any consumer to make use of this):
<div itemscope itemtype="http://schema.org/ItemList">
<link itemprop="additionalType" href="http://schema.org/SiteNavigationElement" />
<ul>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">Link 1</span>
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">Link 2</span>
</li>
</ul>
</div>
Or as an actual MTE (without additionalType):
<div itemscope itemtype="http://schema.org/ItemList http://schema.org/SiteNavigationElement">
<ul>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">Link 1</span>
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">Link 2</span>
</li>
</ul>
</div>
Same as the MTE example above by #unor, except in JSON-LD.
(If your list has id's it makes sense to use them.)
<script type="application/ld+json">
{
"#context":"http://schema.org",
"#type":["ItemList", "SiteNavigationElement"],
"#id": "https://example.com/#nav",
"url":"https://example.com/#nav",
"itemListElement":[
{
"#type":"WebPage",
"position":1,
"name": "home",
"#id": "https://example.com/#home",
"url":"https://example.com/home.html"
},
{
"#type":"WebPage",
"position":2,
"name": "Core Solutions",
"#id": "https://example.com/#core",
"url":"https://example.com/core.html"
}
]
}
</script>
I have some electronic components, and the price is floating.
For example, if you buy 5 pieces, it will be $1 each piece. and you buy 200 pieces, it will be $0.8 each pieces.
There's a order range and price sheet like this:
1~199 $1
200~500 $0.8
Can I mark this up in Schema.org (using Microdata)?
You can do this with multiple PriceSpecification (or in your case probably UnitPriceSpecification) items.
The eligibleQuantity property can give the quantity range in a QuantitativeValue item, with its minValue and maxValue properties.
If you want to provide a unitCode, you can use UN/CEFACT Common Code’s C62.
Based on your example (from the comment), it could look like this in Microdata:
<div itemscope itemtype="http://schema.org/Offer">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
<div itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
<meta itemprop="unitCode" content="C62" />
<span itemprop="minValue">1</span>-<span itemprop="maxValue">100</span>:
</div>
NT$<span itemprop="price">6.65</span>
</div>
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
<div itemprop="eligibleQuantity" itemscope itemtype="http://schema.org/QuantitativeValue">
<meta itemprop="unitCode" content="C62" />
<span itemprop="minValue">101</span>-<span itemprop="maxValue">200</span>:
</div>
NT$<span itemprop="price">5.70</span>
</div>
</div>
I am trying to implement Schema.org structured data to my website. On one of my pages, I have a possibility for users to rate and review a tourist attraction (for example St. Stephan's Cathedral in Vienna). Now I want to enhance my HTML with structured data for it.
Here is an example code of it (also available on http://pastebin.com/u8YZtrpW):
<!doctype html>
<html lang="de">
<head></head>
<body itemscope itemtype="http://schema.org/WebPage">
<div itemscope itemtype="http://schema.org/Place">
<article class="boxy-full">
<div>
<div class="rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" title="Rating: 4.50/5 <br># Ratings: 10">
<meta itemprop="ratingValue" content="4.50"/>
<meta itemprop="bestRating" content="5"/>
<meta itemprop="ratingCount" content="10"/>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star-empty"></i>
</div>
</div>
<h1 itemprop="name">Vienna - St. Stephan's Cathedral</h1>
<div class="ccheader">
<meta itemprop="image" content="/myimg.jpg"/>
<img src="/myimg.jpg" alt="St. Stephan's Cathedral"/>
</div>
<div class="content">
<p>Here comes some text to describe the Place...</p>
</div>
</article>
<div class="boxy-full">
<h2>User-Bewertungen</h2>
<article class="blueblock" itemscope itemtype="http://schema.org/Review">
<div class="pull-right" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="ratingValue" content="5"/>
<meta itemprop="bestRating" content="5"/>
<meta itemprop="worstRating" content="1">
<div class="rating" title="Rating: 5/5" data-placement="bottom">
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
</div>
</div>
<meta itemprop="itemreviewed" content="Stephansdom in Wien">
<h3 itemprop="name">Review 1 Title</h3>
<div class="co" itemprop="reviewBody">
Here comes some review text...
</div>
<footer class="small">Created by Gastuser, on 19.01.2015
<meta itemprop="datePublished" content="2015-01-19">
</footer>
</article>
<article class="blueblock" itemscope itemtype="http://schema.org/Review">
<div class="pull-right" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="ratingValue" content="5"/>
<meta itemprop="bestRating" content="5"/>
<meta itemprop="worstRating" content="1">
<div class="rating" title="Rating: 5/5" data-placement="bottom">
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
<i class="glyphicon glyphicon-star"></i>
</div>
</div>
<meta itemprop="itemreviewed" content="Stephansdom in Wien">
<h3 itemprop="name">Review 1 Title</h3>
<div class="co" itemprop="reviewBody">
Here comes some review text...
</div>
<footer class="small">Created by Gastuser, on 19.01.2015
<meta itemprop="datePublished" content="2015-01-19">
</footer>
</article>
</div>
</div>
</body>
</html>
My problem now is, that the Google webmaster tool for testing structured data (https://www.google.com/webmasters/tools/richsnippets) gives me the following error message:
No rich snippet will be generated for this data, because it appears to include multiple reviews of an item, but no aggregate review information.
But there is an aggregated rating markup. What I am doing wrong?
I don’t know why Google’s old SDTT reports this, but their new SDTT doesn’t:
Apart from the author property that Google would like to see for the Review items, no relevant errors or warnings are reported.
This is The structure of my first page site
<body>
<div class="header"></div>
<div class="left_col">List of last articles/news</div>
<div class="center_cod">List of feature articles/news</div>
<div class="right_col">other thing like ads,and other item list</div>
<div class="footer"></div>
</body>
What do you suggested me to use Microdata in each of element?
<body itemscope itemtype="http://schema.org/WebPage">
<div class="header" itemscope itemtype="http://schema.org/WPHeader"></div>
<div class="left_col" itemscope itemtype="?">List of last articles/news</div>
<div class="center_cod" itemscope itemtype="?">List of feature articles/news</div>
<div class="right_col" itemscope itemtype="?">other thing like ads,and other item list</div>
<div class="footer" itemscope itemtype="http://schema.org/WPFooter"></div>
</body>
Yes I know there is 'itemscope itemtype="http://schema.org/WPSideBar"' for sidebar...But I wana more cutomize it... for example can I use 'blog' or something like this?
My data is spread all over so I can't keep this format :
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">
<p itemprop="description">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">
</div>
</div>
Like you see in the code below the first thing on the page is the category path which has to be inside Offer schema than I have the image and the title which belong to Product than I have eligibleQuantity that again belongs to the Offer and so on....
So I added the :
<div itemscope itemtype="http://schema.org/Product">
In the beginning of the page and closed it at the end and than whenever I had an element that does not belong to the product schema like "eligibleQuantity" for example I would do this:
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
</div>
The problem is I don't know if this is the correct way to do it and can't figure another way. I also get the "Warning: Incomplete microdata with schema.org."
Here is a link to the page :
https://www.pchounds.com/item.php?id=82627#.UTi7kRz_mSp
and below is some code from the page so you can have an idea what I did. Thank you.
<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="breadcrumb"> {L_041}:<span itemprop="category"> {TOPCATSPATH}</span> </div>
...........................................................................................
!-- IF B_HASIMAGE -->
<div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image"
src="{SITEURL}getthumb.php?w={THUMBWIDTH}&fromfile={PIC_URL}" border="0" alt="title" align="center"><br>
<h1 itemprop="name" style="line-height:24px;">{TITLE}</h1>...........................................................................................
<!-- IF QTY gt 1 -->
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
</div>
<!-- ENDIF -->
<!-- IF B_HASENDED -->
{L_904}<br />
<!-- ENDIF -->
<!-- IF ITEM_CONDITION -->
<b> {L_1036}:</b> <span itemprop="itemCondition">{ITEM_CONDITION}</span><br />
<!-- ENDIF -->
<!-- IF ITEM_MANUFACTURER -->
<b> {L_1037}:</b> <span itemprop="manufacturer">{ITEM_MANUFACTURER}</span><br />
<!-- ENDIF -->
<!-- IF ITEM_MODEL -->
<b> {L_1038}:</b> <span itemprop="mpn">{ITEM_MODEL}</span><br />
<!-- ENDIF -->
<!-- IF ITEM_COLOUR -->
<b> {L_1039}:</b> <span itemprop="color">{ITEM_COLOUR}</span><br />
<!-- ENDIF -->
<!-- IF ITEM_YEAR -->
<b> {L_1040}:</b> {ITEM_YEAR}<br />
<!-- ENDIF -->
</small>
offer must have a price, <span itemprop="price"> must be followed by the value of the price but is not and there are multiple Offers when there should just be one. Looking at the current test results from Google's structured data testing tool there are 5 errors, each states the price is missing.
The problem seems to be that each part of the offer has a separate `http://schema.org/Offer' at the start - so it is expecting 5 prices, one for each of the 5 offers.
What you need to do is declare http://schema.org/Offer' **once**, for example an extra` which remains open until all offer values are added.
<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div class="breadcrumb"> Item category:<span itemprop="category"> All > Electronics > Audio > Audio Components > Speakers</span>
</div>
<div class="row">
<div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image" src="https://www.pchounds.com/getthumb.php?w=120&fromfile=uploaded/82627/82627.jpg" border="0" alt="title" align="center"><br>
</div>
</div>
</div>
<div class="span5">
<h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
<div><!-- schema.org/Offer removed -->
<em>
<p><small>Buy Now:
<span itemprop="price"><b>108.91</b> USD</span></small></p>
</em>
</div>
<div class="span5">
<h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
<div> <!-- removed http://schema.org/Offer -->
<em>
<p><small>Buy Now:
<span itemprop="price"><b>108.91</b> USD</span></small></p>
</em>
</div>
Shipping fee: <b>8.00</b> USD<br />
<small>Ends within:
<span id="ending_counter"><span class="errfont">closed</span></span><br />
<p> Seller location: United States<br />
<div> <!-- removed http://schema.org/Offer -->
<b>Payment methods:</b><span itemprop="acceptedPaymentMethod"> PayPal</span> </p>
</div>
</small>
...
</div>