Settings have no effect at all in Drupal 10

Created on 16 November 2023, about 1 year ago
Updated 3 May 2024, 7 months ago

Problem/Motivation

I was using version 2.1x in multiple Drupal 9 projects very effectively and likewise when using Drupal 9, upgrading to 3.x was fine too.

I was able to render the Title fields exactly as I wanted with different settings for the various Display modes.

HOWEVER, I have only just noticed that neither 2.1x nor 3.x appear to work at all in Drupal 10 at all in the sense that my Manage Display settings for any node Title field have absolutely no effect at all on the rendered field.

For example, here is a screenshot for a simple adjustment made to the Manage Display settings for the Basic page content type...

So the result should be that I see all Basic page Titles wrapped in h2 and containing a link but, ...

After Drupal cache-clearing and browser cache-clearing rendered mark-up for the Title field appears...

(Twig debug mode ON)

<h1>
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'entity_page_title' -->
<!-- BEGIN OUTPUT from 'core/themes/stable9/templates/field/entity-page-title.html.twig' -->
<span>
  A Basic page
</span>
<!-- END OUTPUT from 'core/themes/stable9/templates/field/entity-page-title.html.twig' -->
</h1>

I have tested this with Drupal 10.1.6 using Olivero as the default theme as well as other themes such as Bootstrap 5.

Nothing at all seems to have any effect!?

Now I feel that I must need to do something differently in Drupal 10 but I'm a bit stumped because there don't seem to be others reporting similar symptoms?

Can anyone shed any light here please?

Thanks

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

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

Comments & Activities

  • Issue created by @SirClickALot
  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset
  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset
  • πŸ‡¬πŸ‡§United Kingdom juc1

    @SirClickalot have you tried enabling the core field_layout module as mentioned here https://www.drupal.org/project/manage_display/issues/3306918 πŸ› Title field only seems to render when Field Layout (core) module is enabled Closed: duplicate

  • Status changed to Closed: works as designed 10 months ago
  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    Hi @SirClickalot,

    actually, there is no title field on the page. It renders the page title (you can check the twig output).

    for rendering the page title as a field you can:
    1. use layout builder and add the title field to any position you want.
    2. add access and force show the title as a field. it can be done e.g.

    function theme_preprocess_node(&$variables) {
      $variables['content']['title']['#access'] = TRUE;
    }
    

    in both cases, $tag will be added as a wrapper.

    thanks

  • πŸ‡¨πŸ‡¦Canada bohemier QuΓ©bec city, Qc

    I find that this module fixes some long-time inconsistencies, especially with the handling of title.

    Is there a reason for having #access=false by default? Doesn't this defeat the purpose of the module? After setting a field formatter for title, a user would expect that field to be displayed, just like the OP mentioned.

    Or perhaps there could be a configuration form somewhere to allow access?

    Thanks!

  • leymannx Berlin

    Also to me this is really confusing. I think the module should clearly state these limitation on both the module page and in the README. This would help a lot to get the people maybe even create the MRs that are missing to make this work OOTB. Should we add an issue for it?

  • πŸ‡©πŸ‡ͺGermany 4kant

    I agree with @leymannx.
    Luckily I found this issue...

    I donΒ΄t want to use layout builder by the way.

    Thanks for the module!

Production build 0.71.5 2024