page-title.html.twig still show the wrapper styling.

Created on 28 November 2015, over 9 years ago
Updated 1 November 2023, over 1 year ago

Problem / Motivation

I have page-title.html.twig template in my theme D8 and is not been showing the {{ title }}. However is been displaying all wrappers around the title.

Here is my page-title.html.twig.
page-title.html.twig

{{ title_prefix }}
{% if title %}
<div class="sixteen floated page-title">
    <h2 class="title_page" {{ title_attributes }}>{{ title }}</h2>
</div>
{% endif %}
{{ title_suffix }}

Here is the output of this template page-title.html.twig.

<div class="sixteen floated page-title">
    <h2 class="title_page"></h2>
</div>

Why this is a problem ?

Because this is rendering unnecessary HTML and classes. This can affect the output of the page.

Solution

We should make sure that if we exclude the title, anything from page-title.html.twig should be remove.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States darol100

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

Merge Requests

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