delahaye / dlh_googlemaps

Google Maps Extension für Contao
20 stars 26 forks source link

Don't use <section> in Element Template #42

Closed fritzmg closed 9 years ago

fritzmg commented 10 years ago

The HTML5 templates of all the element templates (module and content element) use the HTML5 <section> tag. However, this doesn't make sense in general. It changes the outline of the document in a way the developer/user doesn't necessarily want.

Take for instance this example structure:

<h1>Page with maps</h1>
  <h2>Some info</h2>
    <p>The info</p>
  <h2>The maps</h2>
    <h3>Map 1</h3>
      <div>The map</div>
    <h3>Map 2</h3>
      <div>The map</div>

The outline of this structure is

But since your templates use the <section> element, which creates the following basic structure:

<h1>Page with maps</h1>
  <h2>Some info</h2>
    <p>The info</p>
  <h2>The maps</h2>
  <section>
    <h3>Map 1</h3>
      <div>The map</div>
  </section>
  <section>
    <h3>Map 2</h3>
      <div>The map</div>
  </section>

The outline would be:

Just to emphasize: <section> is not a replacement for <div>. <section> structures the semantic meaning of the document's content. Think of it like sections in a book, scientific document, thesis etc.

More information: http://www.smashingmagazine.com/2013/01/18/the-importance-of-sections/ http://html5doctor.com/the-section-element/ http://gsnedders.html5.org/outliner/

delahaye commented 9 years ago

You're right, thanks. I'll change it in the next version to a div.