Closed (fixed)
Project:
Semantic Views
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
9 Sep 2009 at 08:34 UTC
Updated:
25 Mar 2017 at 20:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI don't like this patch one bit, but I'm posting it to provoke feedback.
I don't know the ways people might use HTML elements other than label to wrap the label of their field. The most obvious semantic alternative would be to use definition lists, but this requires a different structure than the current template allows. At some point, I may be making the theme too complex once again.
Comment #2
seutje commentedhttp://www.w3schools.com/tags/tag_label.asp
http://www.w3.org/TR/html401/interact/forms.html#h-17.9
http://www.w3.org/TR/WCAG10-HTML-TECHS/#forms-labels
&
a label without an input will probably confuse users and in my personal opinion, a label without a for attribute is pretty much worthless fluff
I'm not trying to just tear down your proposal, just wanna point out that this is not the purpose of the
<label>tag and there's a very good chance it will have more negative impact than it would have a positive onefrankly, I think this isn't related to semantics but accessibility, as these labels are usually read by a screenreader when the user tabs into the field and they act as a trigger for the element they are bound with (user clicks label, input gets focussed or changes)
unfortunately, I don't have another suggestion, apart from maybe using a heading of a high type (like
<h5>or<h6>)Comment #3
Anonymous (not verified) commentedseutje:
The label is an artifact from the fork of Drupal Views fields output row style, and I agree that it's a funny usage of label though it isn't invalid HTML it's just bad semantics.
Either headings or (for some view themes) definition list terms? I should bring out the "label" element in the row style options (so users can use dt, label, headings, etc.), let users choose a class attribute too? I can't support 'for' even if I tried, because that would require each field to have a unique ID. Right?
Comment #4
seutje commentedoh I'm sorry, I just saw the example on the project page and the first thing that sprung to mind was "what the hell, a label for a... span?" and then I noticed this in the patch in #2:
but I didn't notice this was mearly a default setting so my apologies for jumping to conclusions
I think a
<dl>would be rather hard to implement properly because the element for the label would then be<dt>and the item itself would be<dd>and then the entire row would have to be wrapped in a<dl>, so a row would look likeso that would mean that this checkbox (?) would override all the label and content element_type settings
this would possibly lead to other problems, imagine the following row with a single label & field:
but I guess markup in the value will always be somewhat of a cause for worrying
so to recap, I think if u want to use definition lists, it should be a rowstyle or you would have to have a configurable row element and label/value elements so the user can manually set the row element to
<dl>, the label element to<dt>and the value element to<dd>, which is really flexible and allows the user to make all the choices, but it also allows the user to easily make mistakes so I dunno... guess it's better to have it as a row style and then still allow the user to add an extra wrapper element to label/valueoh and yea, I think adding classes would be rly nice, so a user can use
<div>for both the label and the value and simply give them a different class (but I think views adds a field-fieldname class by default)Comment #5
Anonymous (not verified) commentedHere's a new patch. It's basically the same as the previous patch except it respects site builders who are already using the module by not breaking their options arrays on existing views.
I want to play more with definition lists. It seems like it could be an easy thing if the CCK multiple value handler can wrap each field value's content.
Comment #6
Anonymous (not verified) commentedBad patch above. Review this one instead.
Comment #7
Anonymous (not verified) commentedseutje:
Any feedback you can give on the patch above would be helpful. I want to release soon, and this patch doesn't need to be left out.
Comment #8
BenK commentedSubscribing....
Comment #9
Anonymous (not verified) commentedBecause nobody gave any feedback on this patch, I rolled a release and committed my work to the DRUPAL-6--1 branch. It works, but it may not be what makes the most sense. Please let me know on a new issue.
http://drupal.org/cvs?commit=331290