-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structured data support in Protostar #7192
Conversation
When an extension enriches it's content with schema.org meta data, then the W3C validator will complain like `The itemprop attribute was specified, but the element is not a property of any item. <p itemprop="startDate" content="2015-06-18T21:35:00+00:00">` This situation can easily be solved with the proposed code change.
I second @laoneo on this request. Please consider applying this patch. |
@0sh0 With any patch it is not about voting for it but testing it. If you want to see this being applied then please follow the testing instruction and report your findings |
My feeling is that this microdata stuff is getting ridiculous. What value is there to define a HTML page as "webpage"? Aren't all HTML pages webpages? Even schema.org seem to agree with that (from https://schema.org/WebPage):
So it should be valid even without that itsemscope. Your example is probably a bad example, as "startDate" isn't a valid property for a WebPage if I read https://schema.org/startDate correctly. It should be contained in an "Event" type. |
The example I've posted is an excerpt of a complete structure within an event which looks like when you install the upcoming module. You can think about this as scopes. A root scope is the WebPage and it can contain other elements like Events and so on. Did you understand it? The upcoming module creates the following structure, which is valid structured data:
|
The I would suggest you just remove the "event" itemprop from your module. This is the real issue as it will be an invalid property on most pages anyway. |
This suggestion does not fix and does not really improve something. I am agree with @Bakual , upd: check that http://webmasters.stackexchange.com/a/52592 |
The problem is that the upcoming module delivers multiple events which must be wrapped inside a root itemprop. The problem is that the W3C validator fails and reports the problems mentioned in the description. The fix is not something it did out of curiosity, but a suggestion from SO http://stackoverflow.com/questions/29123445/validation-error-the-itemprop-attribute-was-specified-but-the-element-is-not. The HTML code generated by the module is absolutely fine. |
A better explanation why it could make sense to wrap the whole page inside a WebPage |
You can have the Event as a standalone scope. It doesn't need to be tied to a root element at all. So just remove the itemprop but leave the scope and type in. Then it's valid.
|
Actually, that link says the same as I do. Wrapping it into a "WebPage" type is invalid:
|
Thanks for your solution @Bakual it indeed does work. Got a free tutorial about structured data :-). |
You're welcome. My head exploded a year ago when I read up on that stuff. I still can remember a bit of it though 😄 Closing as it's resolved. |
When an extension enriches it's content with schema.org meta data, then the W3C validator will complain like
The itemprop attribute was specified, but the element is not a property of any item.
<p itemprop="startDate" content="2015-06-18T21:35:00+00:00">
This situation can easily be solved with the proposed code change.
Test instructions: