hi, sorry for my bad english first of all.

I think using a unordered list to render the list of vocabulary terms isn't semantically correct.

W3C suggest to use a DEFINITION LIST instead, like this example:

<dl>
   <dt><a href="destination">Term 1</a></dt>
   <dd>Term 1 explanation</dd>
   <dt><a href="destination">Term 2</a></dt>
   <dd>Term 2 explanation</dd>
</dl>

From W3C:

Definition Lists

A definition list is not a list of items. This is a list of terms and explanation of the terms.

More, ad DL structure is more easy to format with CSS, instead use of SPAN inside a link.

That's my 2 cents.

Regards

MXT

Comments

xano’s picture

In my opinion terms (the Drupal ones) are no definitions like jargon. That's why I chose for using unordered lists. The term descriptions are not (always) explanations of the terms, but mostly offer some more info about the term.

mxt’s picture

Ok I understand what is the scope.

I'm a newbie on Drupal: is there a possibility to override the module HTML output isn't it? If so i think is easy for everyone to personalize results by necessity.

Thank you!

MXT

PS: look at my request for this module

xano’s picture

Yes, there is. You should check the Handbooks on theme development. You can look up the markup for vocabindex 6.x-1.x-dev in the *.tpl.php files in the module's directory. The code for 5.x-1.x-dev can be found in the *.module file. Do not edit this code. You should override the theme functions if you want to use your own markup. You can find more information on doing this by following the link above.

Any other input on this issue (Using definition lists) would be appreciated.

nancydru’s picture

The Glossary module does use DL for listing the terms. I'm with MXT on this one.

xano’s picture

I'm not. Two reasons:

  1. The W3C uses of the word 'terms' refers to terms like jargon in my point of view. Drupal's terms don't necessarily have to be jargon.
  2. What about terms without descriptions? They would cause the definition lists to have terms without definitions. Not very useful in my opinion.
xano’s picture

Status: Active » Closed (won't fix)
nancydru’s picture

According to the W3C recommendations:

Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.

"Block-level content" may be null (empty).

I don't see the word "jargon" in that recommendation anywhere. Indeed, they suggest "Another application of DL, for example, is for marking up dialogues..."

The point is that DL is for any two-part list, and the second part may be empty. Use of DL is quite common in core and other contribs.

xano’s picture

Status: Closed (won't fix) » Active

I'm going to re-read those recommendations.

xano’s picture

I'm am thinking about changing the ULs to DLs, but I'm not convinced yet.

More, ad DL structure is more easy to format with CSS, instead use of SPAN inside a link.

The whole point of those spans inside the links is that they are clickable too. That would be harder to achieve when using DLs.

nancydru’s picture

I do it in several modules.

xano’s picture

What? Using DLs or styling them the way I style ULs with spans inside the list items? The way it's done now is good for usability, both the term title and the description are part of the link. When using DLs (which might be semantically more correct) this will require two separate links, which decreases the quality of the code. I don't mean to question your decisions, but this is not about what everybody else is doing, but what is the correct or more practical approach. I appreciate any input though, so if you have more reasons for doing it your way, please share them.

shelleyp’s picture

I noticed there hasn't been anything recent on this. I rather agree with you, Xano, because I'm looking at the overall purpose behind the list.

The only thing that matters on the list is the list of items. The description (not definition) of the item is of secondary importance, at best. When I use your vocabulary index pages in a menu, the description is used in a title attribute, and is displayed when the cursor is over the item, but it's nothing more than a tip or hint--not the reason for the list. The item is meaningful without the description.

It would be the same in the W3C example by adding a tip for the recipe listing: for sugar, you'd have a tip that states (refined white sugar), oil (vegetable only) -- see what I mean? You're not listing the recipe items in order to define the items. You're listing the items because the list is, itself, the meaningful object.

Folks, don't look at the presentation of an item and derive the meaning-- look at the purpose, and then use markup accordingly. Xano is providing a list of linked terms within a vocabulary page. It would be meaningful without the "tips" associated with each item. A definition list is not really meaningful without definitions. Even when a definition is not provided, it's assumed that no definition is the exception, not the rule, because the purpose of the list is to define the terms.

Xano could provide a mechanism where a person could override the UL and use definition lists, but then that would propagate semantics he doesn't agree with.

Xano, I would recommend you close this one out and not make the change. My 2 cents.

shelleyp’s picture

Had another confirmation: in HTML5, a definition list item is one or more names with one or more values. Vocabulary terms do not require a description. Therefore, using a definition list with a Drupal Vocabulary term is not semantically correct.

xano’s picture

Xano could provide a mechanism where a person could override the UL and use definition lists, but then that would propagate semantics he doesn't agree with.

This is already possible by overriding the template files, so if people have a situation in which DLs are the way to go they can replace of the ULs this way.

xano’s picture

Status: Active » Closed (won't fix)

I am going to mark this a won't fix again. I still doubt about what solution is semantically more correct, but using

    s is more practical in the current situation.