Use headings as suggested by HTML5 document outline specifications

Created on 29 September 2014, about 11 years ago
Updated 19 August 2025, about 2 months ago

Problem/Motivation

In HTML5 each section of a html page may use h1 as the html tag of the section title. Also the page title should use h1 becouse that is the root, the main title of the outline.

Unfortunately

There are currently no known implementations of the outline algorithm in graphical browsers…

so this issue must be postponed until browsers implement this feature.

Read more here:
- http://www.w3.org/html/wg/drafts/html/master/sections.html#outlines
- https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML_sections_and_outlines
- http://webdesign.tutsplus.com/articles/the-truth-about-multiple-h1-tags-in-the-html5-era--webdesign-16824

Proposed resolution

Change the html tag to h1 in node.html.twig

  {{ title_prefix }}
  {% if not page %}
    <h2{{ title_attributes }}>
      <a href="{{ url }}" rel="bookmark">{{ label }}</a>
    </h2>
  {% endif %}
  {{ title_suffix }}

Remove the "content title" conditional (see below) from page.html.twig:

        {% if title %}
          <strong class="site-name">
            <a href="{{ front_page }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
          </strong>
        {% else %}

Remaining tasks

1. Wait 'till browsers implement document outline.
2. Make the changes suggested in the proposed resolution section above ^^

User interface changes

Moe h1 tags… ;)

API changes

None.

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component

theme system

Created by

🇭🇺Hungary thamas Hungary

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024