Can we have multiple itemprop for one microdata labeling item

Can we tag a single html element with multiple "itemprop" properties? I am working on microdata tags. (Schema.org)

<asp:HyperLink ID="hlnk10" itemprop="url" itemprop ="manufacturer" runat="server"> </asp:HyperLink> 

The hyperlink text contains both properties that I want to mark. Is this possible according to the schema.org standards?

Thanks in advance.

+6
source share
1 answer

My reading of the specification leads me to the conclusion that you can only have one itemprop attribute for each item, but it can have more than one value.

"Each HTML element can have the itemprop attribute specified ... the itemprop attribute, if specified, must have a value that is an unordered set of unique space-separated tokens that are case-sensitive, representing the names of the name-value pairs that it adds. Value an attribute must have at least one token. " http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#names:-the-itemprop-attribute

You can try the nu validator or microdata analyzer to check the code and make sure you get the expected result.

So instead of <span itemprop="name" itemprop="description"> you would use <span itemprop="name description">

The Google Rich Snippet testing tool will not be able to process multiple itemprop values. Nonetheless.

I don’t know what this asp will create, but I think you want more: <a href="/" itemprop="url"><span itemprop="manufacturer">The Name</span></a> To access the text content of the link, you add an extra spacing. The value of a will always be just the value of its href attribute. Adding an extra interval to access the text content of the link is a common template.

+13
source

Source: https://habr.com/ru/post/909560/


All Articles