Page title block settings removes pages titles from views pages and group pages

Created on 17 June 2017, almost 8 years ago
Updated 31 May 2023, almost 2 years ago

In the block layout settings (/admin/structure/block) the page title can disabled / enabled per content type.

But this seems to have a major bug:

If you make changes to the page title block settings and disable the page title for one or more node types, then the page title is not shown anymore on views pages and group pages (module: group).

I tested several hours to find out that this bug is not a bug of the Bootstrap theme but a bug of the "Page title block" settings.

Reproduce it:
- enable the view "archive"
- open the view archive, go to /archive
- you can see the title of the views page /archive !
- NOW change the settings of the "Page title" block in blocklayout /admin/structure/block and enable the page title only for articles.
- go to /archive
- the views page "/archive" has no page title anymore
- any other views page has no page title anymore
- /contact page has no page title anymore
- "404 - Page not found" pages have no title anymore
- any group page (module: group) has no page title anymore

This can be reproduced with several themes (Bartik, Seven, Bootstrap, ...).

Where in the core source files could the error be located?

πŸ› Bug report
Status

Active

Version

9.5

Component
BlockΒ  β†’

Last updated about 19 hours ago

Created by

πŸ‡¦πŸ‡ΉAustria drupalfan2

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States loopy1492

    In my .module file in the view preprocess, I did

    $view = $variables['view'];
    $variables['title'] = $view->getTitle();
    

    And was able to use {{ title }} in my template.

  • πŸ‡¨πŸ‡¦Canada darkodev

    Just ran across this while migrating to Layout Builder. Probably not a viable workaround for most, but thought I'd add to the knowledge. I was already using Context module for some Layout Builder block access conditions, so my workaround was to place the Page Title block AGAIN and set the new block's condition to Context's "View inclusion" condition plugin, and then select the views I want it to apply to.

  • πŸ‡¨πŸ‡¦Canada darkodev

    My above comment is overly complicated. You can simply place the title block twice and specify which pages (paths) the second one should appear on.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    I just ran into this odd behaviour, and agree that it's Major, and would be awesome to get fixed, since many users can spend a long time, trying to understand why the titles suddenly vanished in their Views :)

    In the meantime, thanks for suggesting a pragmatic workaround until this gets fixed @darkodev. For example, you can add two page title blocks, like this:

    • "Page title Content types" using Visibility: Content type
    • "Page title Views" using Visibility: Pages

    It works well, and I have added it as workaround in the Issue Summary.

Production build 0.71.5 2024