5

When building a bespoke site a pet hate is that you start with a front-end layout that is semantically sound and robust, but when you try and create said layout as a theme in Drupal, by default the system adds <div> markup around whatever node, field or general piece of information it can find.

The result is that I usually begin with Mothership as a base theme to reduce the noise of excess markup.

Will Drupal 8 (both core modules and shipped themes) adopt cleaner HTML semantics? If so, how might the new front end HTML compare to its Drupal 7 predecessor?

HTML5 is an obvious assumption. The game is no longer "wrap it in a div" as HTML 5 empowers front end developers to a wealth of possible tags in order to best convey meaning (e.g. aside, header, navigation). How will Drupal change to allow this new level of semantics choice to be controlled by developers?

2
  • 5
    I have a strong suspicion you've never come across Fences before. It makes a lot of that extraneous markup configurable, even semantically so.
    – Clive
    Commented Jun 8, 2013 at 2:32
  • seems that all of them do not work for D8.5+ and none of them is ported to D9 Commented Jun 27, 2020 at 10:37

1 Answer 1

5

Why should it change (drastically) -- it embraces a base of HTML5 markup; anything beyond that essentially becomes business need, accessibility requirements or simply put designer preference on what clean and simple means to them.

From HTML5 Initiative page

We want to ensure we're spending our time implementing features that will directly benefit Drupal's user base the most. As part of this initiative we'll focus mostly on:

  • Adding support for the new form elements to Drupal's Form API.
  • Adding new semantic elements in core templates in an appropriate way.
  • Adding ARIA roles to markup to improve accessibility.
  • Simplifying style and script elements.
  • Ensuring input filters and functions accept HTML5 elements.

Does the above goals mean that Drupal 8 HTML markup will be as lean turning on Fences in Drupal 7 and nuking all built-in markup? No, will the base markup be too complex, hardly. It will be designed to meet most peoples needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.