Problem/Motivation
David Rothstein pointed out in #1323830-57: Place title RDFa metadata inside entity HTML element that maybe the empty span element that we insert in the HTML to assert metadata in RDFa should be hidden explicitly in CSS.
Proposed resolution
One of two options:
1. Add the element-hidden (D7) / hidden (D8) class to the span element, like this:
<span property="dc:title" content="title of something" class="rdf-meta hidden"></span>
2. Don't change the HTML markup, but instead add a CSS declaration for the rdf-meta class which we are already using in the span, which would live in a CSS file in the RDF module:
.rdf-meta {
display: none;
}
Remaining tasks
decide & write patch
User interface changes
none
API changes
none
Comment | File | Size | Author |
---|---|---|---|
#14 | drupal7-rdf-mettag-hidden-2301955-14.patch | 883 bytes | er.pushpinderrana |
#9 | interdiff-2301955-9.txt | 802 bytes | lokapujya |
#9 | 2301955-9.patch | 947 bytes | lokapujya |
Comments
Comment #1
scor CreditAttribution: scor commentedI personally prefer option #2.
Comment #2
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@scor, Please review attach patch, followed first approach as instead of writing new css, prefer to go with existing css class.
Please confirm if required, I would go with #2 approach.
Thanks!
Comment #3
scor CreditAttribution: scor commentedEven if we went with option #1, this patch should set the class using an array, not a string of classes.
I'd like to hear what people think of option #2 vs option #1.
Comment #4
Zarabadoo CreditAttribution: Zarabadoo commentedI would personally opt for #1 and use the
hidden
class. Yes, it adds a few bytes per instance to the page, but it is going to have minimal effect. These core Drupal classes have meaning and are established patterns in the project. There is no sense in reinventing the wheel because we save a miniscule amount on page size. I think consistency is more important.Comment #5
scor CreditAttribution: scor commentedthanks for chiming in Al. Let's wait for @er.pushpinderrana to update the patch so we can move forward with this.
Comment #6
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@scor and @Zarabadoo, thankyou for your valuable feedback. Please review attached patch.
Comment #7
scor CreditAttribution: scor commentedManually verified that we're now outputting
class="rdf-meta hidden"
. Good!Comment #8
alexpottThis comment just above in template_preprocess_rdf_metadata seems obsolete - no?
Comment #9
lokapujyaFixed the comment as suggested above.
Comment #10
scor CreditAttribution: scor commentedGood point, Alex. Thanks for fixing the docs, Jamie. Sending back to the RTBC queue.
Comment #11
alexpottCommitted 675f72f and pushed to 8.x. Thanks!
Comment #13
scor CreditAttribution: scor commentedyay! now onto D7.
Comment #14
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedD7 patch. Please review.
Comment #15
scor CreditAttribution: scor commented@er.pushpinderrana you are very fast! thanks!
Comment #18
scor CreditAttribution: scor commentedflaky testbot.
Comment #20
dcam CreditAttribution: dcam commentedComment #22
lokapujyaComment #23
mgiffordGreat that this is RTBC. Adding related issue #1323830: Place title RDFa metadata inside entity HTML element
Comment #25
lokapujyaComment #27
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks!