1

We are using microdata on our website, and I'm wondering if multiple items can refer to another...I'll explain what I'm trying to do.

On a blog page you could have both blog posts and authors associated with an organisation, like this:

<article itemref="organisation" itemtype="http://schema.org/BlogPosting" 
    itemscope>
    <p class="date"><meta content="2014-01-16" itemprop="datePublished" />16-01-2014</p>
    <p>by 
        <span itemref="organisation" itemtype="http://schema.org/Person" 
            itemscope itemprop="author">
            <meta content="Joe Bloggs" itemprop="name" />Joe</span>
    </p>
    <h2 itemprop="name" >Awesome content here</h2>
    <a href="http://www.example.com/awesome-content-here/">Full story</a>
</article>

<div itemprop="worksFor publisher" itemtype="http://schema.org/Organization" 
    itemscope="" id="organisation"> 
    <meta content="MyOrg" itemprop="name">
    <a href="mailto:hello@example.com" itemprop="email">hello@myorg.com</a>
</div>

The organisation would be the worksFor for the author, and the publisher for the post. What I've put is invalid, worksFor and publisher are both applied to both the post and the author.

Is there a way of achieving what I'm attempting here?

Thanks!

Toby

toby1kenobi
  • 1,609
  • 1
  • 14
  • 24
  • `p` and `span` [can’t have a `content` attribute](http://stackoverflow.com/a/18898363/1591669) in Microdata (it’s only defined for the `meta` element). Either use `meta`/`link` and place the human-readable text next to it, or use the `data` attribute and its `value` attribute where appropriate. – unor Sep 03 '14 at 13:16
  • Your `h2` contains `` but has no opening `a` tag. – unor Sep 03 '14 at 13:17

1 Answers1

-1

As noted above:

p and span can’t have a content attribute in Microdata (it’s only defined for the meta element). Either use meta/link and place the human-readable text next to it, or use the data attribute and its value attribute where appropriate.

Here is a sample association using the itemref attribute:

<div id="daughter" itemprop="children" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name">Mary</span>
</div>

<div itemscope itemtype="http://schema.org/Person" itemref="daughter">
    <span itemprop="name">John</span>
</div>

<div itemscope itemtype="http://schema.org/Person" itemref="daughter">
    <span itemprop="name">Julie</span>
</div>
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
  • Why have you added this, that comment was made almost two months ago and I updated my question accordingly? And it's not an answer to my question (can I associate two different items with another)? – toby1kenobi Oct 24 '14 at 11:44
  • Good point. This helps clarify the question and increase the chance of getting a good answer. The answer to a [related question](http://stackoverflow.com/questions/24080142/1113772) may be close. – Paul Sweatte Oct 24 '14 at 17:04