Duplicate main elements when 3col layout used in the Node display

Created on 9 August 2024, 5 months ago
Updated 16 August 2024, 4 months ago

Problem/Motivation

I have duplicate <main ...><section class="ct-layout__main" > in my code, one in the other. Having multiple <main elements goes against the html5 spec.

There is one in the component library which is included from page.html.twig.
https://git.drupalcode.org/project/civictheme/-/blob/1.x/lib/uikit/compo...
There is another one coming from this template.
https://git.drupalcode.org/project/civictheme/-/blob/1.x/templates/layou...

Steps to reproduce

Assuming that you site is including the layout.twig which for example it will if page.html.twig is being used (check in the twig debug), enable layout builder for the node display and choose the civictheme_three_columns layout (which adds another <main>..

Proposed resolution

Civictheme layout plugins shouldn't define "main" without at least some logic checking.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.8

Component

Code

Created by

🇦🇺Australia sime Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024