View Mode renders Title

Created on 30 May 2025, 5 days ago

Problem/Motivation

When we try to render display mode it always adds by default "title". So in case that there is by default "page title" block enabled you will see your page title twice and no possible to hide it (just disable block currently).

1.Create any Article node.
2. Visit the page - you can see title taken from "page title" block - normal behavior:

3. Now try to force to render any display mode like "teaser" with php (mymodule.module):

<?php

use Drupal\Core\Entity\EntityInterface;

/**
* Implements hook_entity_view_mode_alter().
*/
function mymodule_entity_view_mode_alter(string &$view_mode, EntityInterface $entity): void {
$view_mode = 'teaser';
}

4. Enable custom module and visit Article page again:

This bug was tested with ECA module πŸ› Alter Entity View Mode - Forced page title Active first and it was proved here πŸ› Alter Entity View Mode - Forced page title Active it is a core bug instead.

πŸ› Bug report
Status

Active

Version

10.6 ✨

Component

render system

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

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

Comments & Activities

Production build 0.71.5 2024