18 replies [Last post]
Anonymous
Anonymous's picture
Guru
calgary,alberta
calgary,alberta

Here is what I'm trying to do:

<dl>
<dt>Friday, February 9, 2007</dt>
<dd>Event #1<br />Event #2</dd>
<dt>Sunday, February 11, 2007</dt>
<dd>Event #3</dd>
<dl>

On the first date there are two events. Should I have two DDs in there or is it proper with one with the line break? Should I be using an UL instead? Which is more semantic?

Will there be arguments over this? Laughing out loud

Tags:
Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 50 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

I go for the two DD, myself.

I go for the two DD, myself. Try it and see if it validates. If it does then I think that's the solution. If it doesn't then you should try another approach.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Triumph (not verified)
Anonymous's picture
Guru

I've changed it to

I've changed it to this:

<dl>
<dt>Friday, February 9, 2007</dt>
<dd>Event #1</dd>
<dd>Event #2</dd>
<dt>Sunday, February 11, 2007</dt>
<dd>Event #3</dd>
<dl>

Still wondering if I should be using UL instead. HMMM. Semantics are so ... arguable.

Triumph (not verified)
Anonymous's picture
Guru

Ed Seedhouse wrote:I go for

Ed Seedhouse wrote:
I go for the two DD, myself. Try it and see if it validates. If it does then I think that's the solution. If it doesn't then you should try another approach.

It validates. Before I tweaked the script it was doing this:
<dl><dt>Friday, February 9, 2007</dt>
<dd><div class="event">
<span class="summary">Event #1</span></div>
<div class="event">
<span class="summary">Event #2</span></div>
</dd>
<dt>Sunday, February 11, 2007</dt>
<dd><div class="event">
<span class="summary">Event #3</span></div>
</dd></dl>

A DIV around each event inside of the DD. That didn't seem to make much sense to me.

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 50 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Triumph wrote:I've changed

Triumph wrote:
I've changed it to this:
<dl>
<dt>Friday, February 9, 2007</dt>
<dd>Event #1</dd>
<dd>Event #2</dd>
<dt>Sunday, February 11, 2007</dt>
<dd>Event #3</dd>
<dl>

Still wondering if I should be using UL instead. HMMM. Semantics are so ... arguable.

Well, if it wasn't for the double DD it would obviously belong in a DL. If the double DD validates (I think it will but you didn't say) then I think that's your answer.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Triumph (not verified)
Anonymous's picture
Guru

We are posting at the same

We are posting at the same time. Laughing out loud

I'm posting things you've already talked about entire minutes ago. Wink

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 50 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

(No subject)

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 48 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Oh, what the

Oh, what the …

The definition list seems good structurally, but the semantic link may be tenuous. I use it more often than not.

In this case, an ordered list of date with an unordered sublist of events seems more semantically and structurally correct.

<ol>
  <li>
    <h2>date</h2.
    <ul>
      <li>
        <h3>event name</h3>
        <p>time<br />
          place</p>
        <p>description</p>
      </li>
      <li>
        <h3>event name</h3>
        <p>time<br />
          place</p>
        <p>description</p>
      </li>
    </ul>
  </li>
</ol>

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 20 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

On a completely unrelated

On a completely unrelated topic. A definition list can include any number[1] of DT or[2] DD elements in any order and in any combination. Common sense says that the first DT should come before the first DD, but I don't believe that is required by the DOCTYPE.

[1] at least 1
[2] inclusive or, one or the other or both.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

My new best friend has for a

My new best friend has for a while been DL I like them much and use them wherever I can Smile

They are a much overlooked little construct as for not proscribing the order that dt/dd must appear in I would have thought that was more to do with the fact that it is somewhat axiomatic in the same way I'm sure that:
<body>
<p>paragraph text</p>
<h1>heading for paragraph</h1>
</body>

Would validate, yet is a nonsense read semantically?

As for T's question I have to admit I'm not convinced by Gary's example too many 'things' with meaning going on there, a numbered list , page level headings, I think that my preference would be for a DL list on this one, but then again as I have said it is my new best friend Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 20 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Where you are using a script

Where you are using a script to generate the pages you may prefer Gary's markup. It allows you to present different views of the calendar without having to modify the basic markup generated for events.

e.g. In a week or month view, you have an OL list with UL lists of each day's events nested within each element.

In a day view you have a UL list of the day's events and the date is probably a Hx element.

Putting the above aside, I'd probably go with OL/UL markup if I was listing an unbroken sequence of dates and DL/DT/DD if I was listing events and not caring if some dates were missing.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

As ever I guess this all

As ever I guess this all depends on the precise requirements of the data, I see the scripting perspective though, struggling, kicking and screaming as it were at the moment with Drupal

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Triumph (not verified)
Anonymous's picture
Guru

Chris..S wrote:Putting the

Chris..S wrote:
Putting the above aside, I'd probably go with OL/UL markup if I was listing an unbroken sequence of dates and DL/DT/DD if I was listing events and not caring if some dates were missing.

That's the point I was stuck on. The script is only outputting dates with events. Boring days are left out. Tongue

Besides that there may be two or three lists of dates (such as Events, Birthdays and Anniversaries) and that also would break any order as some dates would be repeated in the second or third list and I read Gary's response after I mutilated the script. I just can't bring myself to open that file again. Wink

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Mutilated scripts, sound

Mutilated scripts, sound like a man after my own heart. Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Triumph (not verified)
Anonymous's picture
Guru

Hugo wrote:Mutilated

Hugo wrote:
Mutilated scripts, sound like a man after my own heart. Smile

Oh, yeah. I get them to do what I want, I just hope I never have to go back in there.

Who needs comments or indents on nested ifs? Tongue

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Triumph wrote: Oh, yeah. I

Triumph wrote:

Oh, yeah. I get them to do what I want, I just hope I never have to go back in there.

Who needs comments or indents on nested ifs? Tongue

You're joking I comment my comments, they never make sense to me Smile so I write a detailed explanation of the comment Laughing out loud

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Triumph (not verified)
Anonymous's picture
Guru

Hugo wrote:You're joking I

Hugo wrote:
You're joking I comment my comments, they never make sense to me Smile so I write a detailed explanation of the comment Laughing out loud

So you don't mutilate, you redecorate? Wink

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 48 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

A rococo comment coder, you

A rococo comment coder, you might say.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Leaning towards Neoclassic

Leaning towards Neoclassic

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me