This seems to be the standard for search engine results (see Google, Yahoo, Bing). It allows for easy keyboard navigation with accessibility software. Right now the output is like this:
<dt class="title">
<a href="http://dev.drupal7/node/23">Ratis Iriure</a>
</dt>
Something like this would be better:
<dt class="title">
<h3><a href="http://dev.drupal7/node/23">Ratis Iriure</a></h3>
</dt>
Instead of tabbing through all the links, users of accessibility software could quickly skip directly from heading to heading. This is related to WCAG 2 2.4.6.
Comment | File | Size | Author |
---|---|---|---|
#38 | hook_search_page-v1.patch | 1.15 KB | Jeff Burnz |
#20 | 810176.patch | 531 bytes | jhodgdon |
#17 | search-results.patch | 1.97 KB | bleen |
#15 | search-results.patch | 736 bytes | bleen |
#12 | search-results.patch | 3.17 KB | bleen |
Comments
Comment #1
Everett Zufelt CreditAttribution: Everett Zufelt commentedAgreed. Setting as bug as this is a suggested success criteria for meeting WCAG 2.0 level AA.
Perhaps someone can role a patch for this and make sure it isn't overridden in any core themes.
Comment #2
bleen CreditAttribution: bleen commentedComment #3
mgiffordThis looks good to me. I applied it here with some sample search data:
http://drupal7.dev.openconcept.ca/search/node/magna
It would be great if this got into core. There may be some theming
I've attached the screenshots as there are some differences in styling. I prefer the H3 version, but...
Comment #4
Everett Zufelt CreditAttribution: Everett Zufelt commentedIf we are certain that no core theme overrides this tpl and if there is no theming issue then I think that this is RTBC.
Tagging with needs usability review
Comment #5
Bojhan CreditAttribution: Bojhan commentedI wouldn't know where else this occurs, but looks good yup.
Comment #6
Everett Zufelt CreditAttribution: Everett Zufelt commentedDoesn't look like this is overridden in core themes. Marking RTBC
Comment #7
Jeff Burnz CreditAttribution: Jeff Burnz commentedAccording to the W3C this is invalid. Also the semantics of it irk me, which are dubious to begin with (use of the definition list for search results).
Comment #8
Everett Zufelt CreditAttribution: Everett Zufelt commented@Jeff
Thanks for pointing out the validity issue here. I would tend to agree that search results aren't a definition list. They are however a list.
I checked the spec and dt elements can only contain inline elements.
So, should we switch the search results to a different type of list?
Comment #9
Jeff Burnz CreditAttribution: Jeff Burnz commentedGoogle and Yahoo use an ordered list. Bing uses and unordered list. I think I prefer the Google/Yahoo structure.
Comment #10
bleen CreditAttribution: bleen commentedComment #11
mgiffordOK, I just applied patch #10 here:
Multiple results:
http://drupal7.dev.openconcept.ca/search/node/occuro
Single result:
http://drupal7.dev.openconcept.ca/search/node/Blanditsimilismetuo
Both of these were validated via the w3c: "This document was successfully checked as XHTML + RDFa!"
I've attached a screenshot (one in Hebrew) with all major Mac browsers.
Comment #12
bleen CreditAttribution: bleen commentedsame as #10 except with a minor RTL fix
Comment #13
Dries CreditAttribution: Dries commentedLooks good. Committed to CVS HEAD. Thanks.
Comment #14
Jeff Burnz CreditAttribution: Jeff Burnz commentedIndentation?
Powered by Dreditor.
Comment #15
bleen CreditAttribution: bleen commentedwell spotted
Comment #16
Jeff Burnz CreditAttribution: Jeff Burnz commentedDont want to start a bikeshed but if we follow other core examples for class naming this would be "search-snippet-info". Lets not bikeshed eh fellas? But "wrap" seems out of place.
(sorry bleen, I just spotted this after your latest patch!).
Powered by Dreditor.
Comment #17
bleen CreditAttribution: bleen commentedComment #18
jhodgdonI can't really believe all of the above was committed without any consultation of the search module maintainers.
I am not even going to say any more. This was quick and we are both fairly busy and no one even pinged us and it all happened in less than 1 day. Sigh.
Comment #19
jhodgdonI would also just like to say that we had an issue about this a WHILE back and it was pushed off to D8 as being too major of a change.
Comment #20
jhodgdonHere's a patch for maintainers.txt.
Comment #21
Jeff Burnz CreditAttribution: Jeff Burnz commented#17, awesome - RTBC.
Comment #22
aspilicious CreditAttribution: aspilicious commentedTalked to jhodgdon on irc, please commit #20 together with #17, she is very sure about this.
Comment #23
jhodgdonJust to clarify:
I think the patch committed above was a terrible idea.
I have been increasingly frustrated by the lack of any process/consistency/policy in D7 dev. I am not willing to continue to be the official maintainer of the search module.
I plan to continue to contribute patches to D7 and in particular to the search module. And to review patches. I just don't want to be listed as the official maintainer of the search module.
Thanks.
Comment #24
Everett Zufelt CreditAttribution: Everett Zufelt commented@jhodgdon
Can you expand on your thoughts about why the patch committed is a terrible idea?
Comment #25
Dries CreditAttribution: Dries commentedjhodgdon, I think you are exaggerating when you wrote "terrible idea".
1. It is perfectly OK to commit patches in one day.
2. There has never been a rule that _requires_ consultation of module maintainers (and there never will be).
3. This patch didn't change the search module internals or algorithms; it changed the generated HTML to improve accessibility. In my mind, this patch has almost nothing to do with search module. Furthermore, the accessibility changes were verified by a couple of accessibility experts, is based of Google/Yahoo's approach, and passed W3C validation.
4. There only seems to be disagreement on the names of the CSS classes -- that is hardly a "terrible idea" in my book.
5. It is perfectly OK to rollback a patch that was a terrible idea. That is not a shame. We can talk about it.
Maybe we missed or overlooked something? I, too, would like to understand why this patch was a terrible idea.
Comment #26
jhodgdonSorry, I probably overreacted in saying it was a terrible idea. I have been rather (understatement) stressed out today, and I apologize. I'm also sorry that I have been too busy with client/paying work the last few days to have noticed this very quick patch turn-around, so that I could have commented before it was committed.
So, to address the patch itself.
I am not against accessibility improvements, of course, but I think this particular one was misguided. There is already an H2 heading before the list of search results. It's the header for a list (in this case, before the patch, a DL list). Then what follows is a list -- can't you navigate through the items of the list? To me, putting an H3 header in the middle of a list is VERY weird semantics. It may help screen readers bounce through the page, but it isn't semantically correct in any way that I can understand. Headers are supposed to be section headers, not nested within LI items in a list. It just seems wrong, and I don't see the WCAG guidelines actually suggesting this practice.
The other reason I am unhappy with the committed patch is that I think that changing the list from a DL to an OL was a bad idea at this stage of the D7 process. This would break any theme that has only overridden one of result/results (because they were assuming one structure and it has changed in an incompatible way). Also, the markup changed completely, so any theme that had CSS customizations for search results will have to redo them. It is not really all that minor a change to the search module from the point of view of a theme -- it is a complete change in the default search results presentation.
At a minimum, it needs to be documented in the theme update guide - has someone done that? If this patch stays, it needs to be done.
Comment #27
Jeff Burnz CreditAttribution: Jeff Burnz commentedNot via headings since there are no heading elements to jump through, this is what the whole focus of the patch is about, providing AT users with heading based navigation. Please read up about this if you are unsure what this is.
H3 follows H2 and is correctly nested in this context. LI is merely a generic container, somewhat like a DIV but with different semantics (its a list-item as opposed to a division) - each item can have a heading, divisions, paragraphs, images or whatever. There is nothing wierd about this at all and is a common everyday usage of the LI, its valid and in use by the major search engines.
No core themes do this. If others are building D7 themes and making assumptions before a stable release that's not really our problem. Its not our job to account for the crystal ball gazers. In any case, as a themer speaking here, the changes are quite trivial and I was able to write a patch for Corolla in about 1 minute.
When the patch in #17 lands we'll switch to a documentation issue and write the update.
Comment #28
jhodgdonOK. Just someone PLEASE put this into the theme update guide, once the follow-up patch has been done, and please don't mark this patch Fixed until that has been done. Thanks.
There's no need to change this to a doc component issue. Just mark it "needs work" and I've already added the "needs doc" tag.
Comment #29
Dries CreditAttribution: Dries commentedjhodgdon -- no worries, your apologies are obviously accepted. Happy to see we can have a constructive dialogue.
I committed the patch in #17 but not the patch in #20. The patch in #17 is a clean-up so it does make things regress.
Setting this to 'needs work' for the documentation updates and further discussion.
Comment #30
Jeff Burnz CreditAttribution: Jeff Burnz commentedDocumentation added: http://drupal.org/update/theme/6/7#search-result-headings
Could someone please review the docs, won't set as fixed just yet.
The patch in #20 should perhaps be in its own issue?
Comment #31
Dries CreditAttribution: Dries commentedRe: #20: I'm hopping jhodgdon wants to continue to be a co-maintainer of the search module. jhodgdon, do you still want me to commit that patch? Let's hope not.
Comment #32
jhodgdonI don't have any intention of changing the way/amount I am contributing to Drupal, even if I remove my name as co-maintainer of the search module as a formal protest and expression of my long-term extreme frustration around the lack of consistency in, transparency in, and existence of the process and standards that are used to decide which patches get committed to Drupal.
But this issue is not the place to discuss that (I am not sure what is, but this issue isn't), so let's leave it at that for now.
Regarding #30:
- Both search-result and search-results TPL files changed. You only mentioned search-result.
- CSS changes will be needed, as the HTML markup and classes have changed for both result and results. It would be useful to mention the CSS classes/IDs that no longer exist, and the new ones.
Comment #33
jhodgdonOh, and one other thing: It would probably be helpful to include a before/after (D6 vs. D7) for the entire search results/result so they could easily be compared.
Comment #34
Jeff Burnz CreditAttribution: Jeff Burnz commentedUpdated the docs as per #32, #33 - good point about adding the info on the other template and the D6 stuff.
Pretty reluctant to add much if anything about CSS as this could get long winded. I think its pretty evident to themers that they may need to make CSS updates and we can't really predict what they might be - really depends if they styled using element selectors or class selectors (if the latter they might not need to do much at all, as in Corolla - it was very easy since we were using class name selectors).
Comment #35
Jeff Burnz CreditAttribution: Jeff Burnz commentedComment #36
jhodgdonAgreed. Someone can now at least look at the markup and see how their CSS needs to change.
Comment #37
Jeff Burnz CreditAttribution: Jeff Burnz commentedWe need to update hook_search_page also, and document this both in new comments and the theme changes page, currently this is:
http://api.drupal.org/api/function/hook_search_page/7
Comment #38
Jeff Burnz CreditAttribution: Jeff Burnz commentedI'll give this a crack now.
Comment #39
jhodgdonOK.
Comment #40
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.