-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Social viewlet generates invalid HTML #1087
Comments
ok, so html gets filtered here :) The meta tags with itemprop attributes miss a surrounding span with itemscope attribute. |
@jladage you need to wrap html-like tags with backticks |
When I add a span in the head, the w3c validator starts giving this error: "Stray end tag head." So the first way is probably best. Except that This means that it should be changed in the main template, not in plone.app.layout. |
Added `itemscope itemtype="http://schema.org/WebPage"` to main template html tag. Fixes #1087
-1 and that was one of the reasons I was against of adding this feature to Plone 5 on the first place as discussed in https://dev.plone.org/ticket/20256 first, I don't know why we are adding schema.org markup in the header, that's not documented anywhere; second, we must be careful with this markup as it has to be very easy to override it for add-ons. take, for instance, collective.nitf (a content type that describes a news article); we spend a lot of time adding semantic markup to it and now I think we are going to invalidate it with this change. so, IMO, the solution here is to remove those tags; neither Facebook's Open Graph, nor Twitter Cards, require that. |
@jensens did you read above before merging this? |
well, no. mea culpa. reverted. this one needs discussion. #1355 since i'am not an expert on this, what about a less immersive way than hard-coded in main template? |
thank you! |
From what I see, the Facebook The So it would seem the solution is:
Does that sound good? @hvelarde Is that maybe what you meant with your first comment? At the time, it sounded to me like you wanted to rip all schema stuff out, including what the viewlet in current Plone 5.0 does. |
@mauritsvanrees as I mentioned, including something like Twitter Cards in Plone's core was a mistake as we don't even know if Twitter is going to collapse next month or when the current Tech bubble finally burst. we have 2 different things here: social media markup and semantic markup; so, let's focus on the social media markup first, trying to support only open standards; semantic markup must be addressed on a different issue and then we can discuss where to implement it. besides that, Plone must evolve to support Linked Open Data. |
+1 for any PLIP (inc.implementation) that brings Linked Open Data to Plone :D |
I would love to do that, unfortunately is out of my scope and I have no time/resources to do so. I'm just proposing something that, IMO, is the way to go. |
Moved the schema.org tags to the body in a new viewlet plone.abovecontenttitle.socialtags and added itemScope and itemType there. Fixes plone/Products.CMFPlone#1087
Moved the schema.org tags to the body in a new viewlet plone.abovecontenttitle.socialtags and added itemScope and itemType there. Fixes plone/Products.CMFPlone#1087
Moved the schema.org tags to the body in a new viewlet plone.abovecontenttitle.socialtags and added itemScope and itemType there. Fixes plone/Products.CMFPlone#1087
Branch: refs/heads/master Date: 2016-03-11T13:55:42+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.layout@e96a056 Fixed invalid html of social viewlet. Moved the schema.org tags to the body in a new viewlet plone.abovecontenttitle.socialtags and added itemScope and itemType there. Fixes plone/Products.CMFPlone#1087 Files changed: A plone/app/layout/viewlets/social_tags_body.pt M CHANGES.rst M plone/app/layout/viewlets/configure.zcml M plone/app/layout/viewlets/social.py M plone/app/layout/viewlets/tests/test_social.py Repository: plone.app.layout Branch: refs/heads/master Date: 2016-03-11T13:56:11+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.layout@73d588e Merge pull request #78 from plone/maurits-issue-1087 Fixed invalid html of social viewlet Files changed: A plone/app/layout/viewlets/social_tags_body.pt M CHANGES.rst M plone/app/layout/viewlets/configure.zcml M plone/app/layout/viewlets/social.py M plone/app/layout/viewlets/tests/test_social.py
Branch: refs/heads/master Date: 2016-03-11T13:55:42+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.layout@e96a056 Fixed invalid html of social viewlet. Moved the schema.org tags to the body in a new viewlet plone.abovecontenttitle.socialtags and added itemScope and itemType there. Fixes plone/Products.CMFPlone#1087 Files changed: A plone/app/layout/viewlets/social_tags_body.pt M CHANGES.rst M plone/app/layout/viewlets/configure.zcml M plone/app/layout/viewlets/social.py M plone/app/layout/viewlets/tests/test_social.py Repository: plone.app.layout Branch: refs/heads/master Date: 2016-03-11T13:56:11+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.layout@73d588e Merge pull request #78 from plone/maurits-issue-1087 Fixed invalid html of social viewlet Files changed: A plone/app/layout/viewlets/social_tags_body.pt M CHANGES.rst M plone/app/layout/viewlets/configure.zcml M plone/app/layout/viewlets/social.py M plone/app/layout/viewlets/tests/test_social.py
plone.app.layout's social viewlet defines
<meta itemprop="image" ...>
in the head tag, but it lacks a<span itemscope itemtype="Article"> .. </span>
There are two ways to solve this:
<html>
tag<span itemscope itemtype="Article"> .. </span>
around the metatags with itemprop attributesThose are equal so please choose the one that is easiest to implement ;)
The text was updated successfully, but these errors were encountered: