1

I have a page that contains multiple Schema.org Events that have identical properties (name, location, description, etc.). I've figured out how to handle location by doing something like this:

<div itemscope itemtype="http://schema.org/Event">
  …
  <meta itemprop="location" itemscope itemtype="http://schema.org/Place" itemref="venue-place" />
</div>

<span id="venue-place">
  <a href="http://www.example.com/" itemprop="url">
    <span itemprop="name">Crystal Ballroom</span>
  </a>

  <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <span itemprop="streetAddress">1332 W Burnside St.</span>
    <span itemprop="addressLocality">Portland</span>,
    <span itemprop="addressRegion">OR</span>
    <span itemprop="postalCode">97209</span>
  </span>
</span>

However, I can't figure out how to do this for the Event's description. I've done something like this, which makes an empty description appear in the Event in Google's Structured Data Testing Tool:

<div itemscope itemtype="http://schema.org/Event">
  …
  <meta itemprop="description" itemscope itemref="event-summary" />
</div>

<div id="event-summary">
  This is the description text.
</div>

What am I doing wrong?

unor
  • 82,883
  • 20
  • 183
  • 315

1 Answers1

2

The itemref attribute allows you to reference properties (itemprop), and it has to be specified on the item (itemscope) these properties should be added to.

So you have to

  • move itemref="event-summary" to the Event element, and
  • move itemprop="description" to the element with the description.
<div itemscope itemtype="http://schema.org/Event" itemref="event-summary">
</div>

<div itemprop="description" id="event-summary">
</div>

You would ideally do this for the location, too, because having a meta element without a content attribute is invalid (but this could be fixed by adding an empty attribute), and because you could save one element that way.

<div itemscope itemtype="http://schema.org/Event" itemref="venue-place event-summary">
</div>

<div itemprop="location" itemscope itemtype="http://schema.org/Place" id="venue-place">
</div>

<div itemprop="description" id="event-summary">
</div>

(Note that Google’s Structured Data Testing Tool will use the id value of the Place element to display URIs under @id. I think that’s a bug on their end, so don’t let this confuse you. If you want to get rid of it, you could add an itemid attribute in addition to provide a real/actual URI for the place.)

Community
  • 1
  • 1
unor
  • 82,883
  • 20
  • 183
  • 315