Allow node/entity to display title/label field as normal

Created on 28 May 2020, about 4 years ago
Updated 17 May 2024, about 1 month ago

After this module is enabled on all of my nodes in standard view (URL /node/xxx) the title is not displayed.

I can move the title field in Manage display section of all content types to another position, but when I view the node (/node/xxx) the title is not show in none of the positions. Page title is show but I do not need the page title on my nodes and can disable the page title. But the node title is needed on different positions.

Same behavior with Bartik theme (core). How can we repair this?

✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria drupalfan2

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.

  • πŸ‡¦πŸ‡ΉAustria drupalfan2

    The Manage display still does not work. No title is show on node page (node/xxx).

    The patch #24 is not working!

    Actually the submodule manage_display_fix_title does only contain 1 file:
    manage_display_fix_title.info.yml

    A file manage_display_fix_title.module is missing!

    The Manage display module is unusable! I had to remove it. It does not work.

  • πŸ‡³πŸ‡±Netherlands Martijn de Wit πŸ‡³πŸ‡± The Netherlands

    I would opt in for option 3 from #4

    Funny fact: If you enable Field Layout (core) module, option 3 is working out of the box.

  • πŸ‡³πŸ‡±Netherlands Martijn de Wit πŸ‡³πŸ‡± The Netherlands
  • πŸ‡³πŸ‡±Netherlands firfin

    @Martijn de Wit comment 29 Enabling Field Layout from core does not fix this for me. Any other settings needed that you know of?

    @Moser comment #24 patch does not apply to 3.0 version for me, any chance to get a patch for this version?

    For now I just made my own module with this code in it, thanks.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    I have a pretty vanilla install I am working on. After enabling the 3.0 branch of this module, and enabling field_layout, the title field appears on my node.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States sim_1

    I don't know how to change the target to the 3.x branch, but I update the MR to use the solution from #23 with some minor tweaks. I don't think the solution is perfect, but I'm also just still trying to wrap my head around it so it's such a relief that it at least gets the title on the page. My main issue is that I don't understand why the "label" render array value goes away when this module is enabled. It breaks assumptions that are made in core node templates, as well as contrib themes. But again, I'm just relieved something works!!

  • πŸ‡ΊπŸ‡ΈUnited States sim_1
  • πŸ‡«πŸ‡·France Guillaume Aveline

    I had the same issue.
    After taking a look at `EntityViewController::buildTitle()`, I saw at the end:

            // Prevent output of the label field in the main content.
            $page[$label_field]['#access'] = FALSE;
    

    So I made this hook

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

    And it seams to do the job, at least for me.
    I Hope I'm not breaking something, :)

  • πŸ‡³πŸ‡±Netherlands gbr

    #29, enable Field Layout (core) module.
    Did work for me.

    Thanks!

  • I got it to work using hook_node_view as outlined in #23.
    The trick is simply to move 'title' into something named differently, like "_title"

Production build 0.69.0 2024