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...

manage-display-module-configured-to-adjust-basic-page-default

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

Proposed solution

Document the steps required to allow re-ordering the Title on the Display page, and add it to the README and project page. For example, is Layout Builder required? Also, should the user then delete the Title Block, or simply disable it, for that specific content type?

Comments

SirClickalot created an issue. See original summary.

sirclickalot’s picture

Issue summary: View changes
sirclickalot’s picture

Priority: Normal » Critical
juc1’s picture

@SirClickalot have you tried enabling the core field_layout module as mentioned here https://www.drupal.org/project/manage_display/issues/3306918

astonvictor’s picture

Status: Active » Closed (works as designed)

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 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

bohemier’s picture

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!

norman.lol’s picture

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?

4kant’s picture

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

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

Thanks for the module!

ressa’s picture

Title: Settings have no effect at all in Drupal 10 » Document how to allow changing position of Title field under Manage display
Version: 3.0.0 » 3.x-dev
Component: Code » Documentation
Category: Bug report » Task
Priority: Critical » Major
Issue summary: View changes
Status: Closed (works as designed) » Needs work

I believe I also just saw this in Drupal 11 ... I installed the module, and "Authored on" and "Authored by" fields were available on the Display page and working fine, but I could not change position of the Title ...

Perhaps someone can add a solution under the "Proposed solution" section I just added in the Issue Summary? For example, if Layout Builder is required, that's a pretty big deal, and important piece of information. Thanks.

ressa’s picture

Or will this be taken care of in #3143678: Allow node/entity to display title/label field as normal, allowing to change the position of Title field in a plain vanilla Drupal 11 installation on the "Manage display" page /admin/structure/types/manage/article/display, simply by installing the Manage display module?

It is pretty hazy to me ... it would be awesome if the README and project page had the minimum required steps to allow changing the position and display of the Title field, as of today. Thanks!

jglynn’s picture

I can confirm that #5

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

makes the title field appear as expected when using this module. Seems crazy to me that I have to add that or the title field is hidden.

adamps’s picture

Is there a reason for having #access=false by default?

It comes from Core EntityViewController::buildTitle().

Should we add an issue for it?

There already is one #3143678: Allow node/entity to display title/label field as normal

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

Yes that would be part of that issue

Seems crazy to me that I have to add that or the title field is hidden.

Yes, but the craziness came from Core. This module is not causing your problem - it is part of the solution to your problem.

I can confirm that #5...

#5 is a good workaround. It's not something we can commit for the reasons in https://www.drupal.org/project/manage_display/issues/3143678#comment-158....

adamps’s picture

Status: Needs work » Fixed

I added a paragraph and a ref to #3143678: Allow node/entity to display title/label field as normal to the project page.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.