- πΊπΈ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.