0

Is it possible to include
itemprop="name" and itemprop="contentURL" in the same element?

as in the example bellow :

    echo '<li itemscope itemtype="http://schema.org/AudioObject" >';
    echo '  <a itemprop="name" itemprop="contentURL" href="http://wave.cat/music/'.$song['file'].'">'.$song['name'].', '.$song['artist'].'</a>';
    echo '</li>';   
coiso
  • 7,151
  • 12
  • 44
  • 63

1 Answers1

2

You can have multiple itemprops like this:

<a itemprop="name contentURL" href="url">name</a>

But in this case you would set the name property with an URI value because you are in an a element. I'm not really sure what effect this would have.

The best way is to scope the name property around the content using an extra span element:

echo '<li itemscope itemtype="http://schema.org/AudioObject" >';
echo '  <a itemprop="contentURL" href="http://wave.cat/music/'.$song['file'].'"><span itemprop="name">'.$song['name'].', '.$song['artist'].'</span></a>';
echo '</li>'; 
Michaël Hompus
  • 3,349
  • 24
  • 35