With the new itemprop metatags my site stopped validating. I have 3 errors like this one:

Line 28, Column 68: The itemprop attribute was specified, but the element is not a property of any item.

<meta itemprop="name" content="Test Site" />

From what i've understand, itemprop is to be set as microdata to some elements rather then to be set in head.

http://schema.org/docs/gs.html#microdata_itemprop

Comments

damienmckenna’s picture

Status: Active » Postponed (maintainer needs more info)

If you check the HTML5 spec it's completely valid:

What validator are you using?

Anonymous’s picture

damienmckenna’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, and another HTML5 validator also shows the same:

https://html5.validator.nu/?doc=http%3A%2F%2Freg.io%2Fc%2F52%2Ftalhof

Darn :-\

Anonymous’s picture

From what i've found here it seems like itemprop is not supposed to be in head after all: http://html5doctor.com/microdata

The example states something like this:

<p itemscope>
  <span itemprop="name" itemscope>Jessica Spengler
    <meta itemprop="likes" content="Mameshiba">
  </span>’s fans are always really raucous.
</p>

Did not know you can use meta like this and the website even states some browser don't know this too. Pretty confusing.

rpayanm’s picture

scor’s picture

Could someone post the HTML markup that is generated and that is not validating? (ideally a full page src please)

rpayanm’s picture

Here the code:

<!DOCTYPE html>
<html>
<head lang="en">
  <meta itemprop="name" content="The Name or Title Here">
  <meta itemprop="description" content="This is the page description">
  <meta itemprop="image" content="http://www.example.com/image.jpg">
  <meta charset="UTF-8">
  <title>My title</title>
</head>
<body>
  My body.
</body>
</html>
tunaman’s picture

@rpayanm It seems to originate from the Google+ sub module, disabling it removes those tags. Nobody uses Google+ anyway right?

capogeannis’s picture

Used for better search result listings, better nav interface in those results for mobile, etc:

https://developers.google.com/structured-data/site-name

https://developers.google.com/structured-data/rich-snippets/products

michee.lengronne’s picture

StatusFileSize
new962 bytes

In fact the itemtype is not set in the html tag. The patch above solves the issue. Your html template needs to be modified.

michee.lengronne’s picture

StatusFileSize
new1.09 KB

This patch is better as it takes the schemaorg module into account.

damienmckenna’s picture

Status: Active » Needs review

@michee.lengronne: Thanks, I'll test out your patches in the next few days.

Please don't forget to update the issue status to "needs review" when you upload a patch, that'll kick off testbot and let others know there's something to review.

Status: Needs review » Needs work

The last submitted patch, 11: metatag-schemorg-page-set.patch, failed testing.

scor’s picture

The markup should be independent of whether the schema.org exists because the schema.org module outputs a different markup (RDFa) than what's being added in this patch (microdata). Patch #10 is the way to go.

michee.lengronne’s picture

Status: Needs work » Needs review

Right. I just saw that after the patch submitted.

The last submitted patch, 10: metatag-schemorg-page-set.patch, failed testing.

michee.lengronne’s picture

Status: Needs review » Needs work

Resubmitting

michee.lengronne’s picture

Status: Needs work » Needs review
StatusFileSize
new962 bytes

Now.

Status: Needs review » Needs work

The last submitted patch, 18: metatag-schemorg-page-set.patch, failed testing.

damienmckenna’s picture

@michee.lengronne: You need to check that the variable exists before appending to it.

michee.lengronne’s picture

Right.

michee.lengronne’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB

there

createchlondon’s picture

Please may I ask what's happening with this fix? The issue with the Google+ meta tags is that it's adding a element. According to Google it should be Your WebSite Name so what is the point of this meta tag?

If it's going to be meta itemprop instead of title itemprop then it needs to be a child element of an itemscope. Please can we elevate this issue for a fix as it's causing problems with accessibility error testing.

damienmckenna’s picture

StatusFileSize
new4.04 KB

Updated to clean up the installation instructions, README.txt, etc.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.