Haven't had a chance to dive too deep into a backtrace, but a page title block placed on a blocks page inside page_manager renders empty, but if it's placed using the site structure UI, it shows the page title as expected. An ideas from someone more familiar with the inner workings of the module?

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bradjones1 created an issue. See original summary.

tim.plunkett’s picture

Status: Needs work » Active

Nothing jumps out at me.

alzz’s picture

Does not work for me as well.

I create a page manager page with a block page variant, place the page_title_block but when it renders the page the title block is empty.
It renders

<div class="block block-core block-page-title-block">    
  <div class="content"></div>
</div>
micbar’s picture

The same happens on a page variant with the page_title_block and the main content block. Using drupal 8.0.5 and the dev version of page manager.

omarlopesino’s picture

Page title block needs title be set before render.

I attach a patch with a possible solution, extracting page title from block page variant configuration, where page title is extracted too.

Can you review this patch, please? This works adding page title in the variant.
Thanks!

omarlopesino’s picture

Status: Active » Needs review
alzz’s picture

#5 works great!

hkirsman’s picture

I tried adding page_title_block to node page content, but the title would not appear (using latest dev of Page manager and Panels but tried also block page). $this->configuration['page_title'] is empty. Shouldn't it show the title of the node?

tim.plunkett’s picture

Only if you configured that variant to show the title of the node.

Michelle’s picture

I confirmed the patch works to make the title show up in the block. It is a bit confusing because the block settings has a title and a checkbox to show the title but that title isn't the one shown and checking the box causes it to show the title that is on the general tab twice. I don't think that has anything to do with this patch but it is a bit confusing.

cornuz’s picture

system_main_block also renders to nothing.

dman’s picture

Still a problem for us today, on the latest -dev.
We are failing to get any title showing up as the page_title_block . (though like above, it can be shown via global block placement)

I'm also expecting tokens or something to work there, but there are no hints that that may be supported. #2561947: Use token browser for "Page title" field

tunic’s picture

@dman, did you try the patch from #5?

dman’s picture

@tunic - I was shoulder-surfing for a colleague at the time, not hot-patching code.

I have now tried out #5 and seen no improvement. However, the site we are working on is unstable/experimental in a few ways already, and I'm getting ongoing other WSOD errors using the page_manager UI that are probably unrelated, and I can't point fingers at it directly. I can't debug much further here, sorry. We have switched to using display_suite for our needs this month.

sylus’s picture

This seems to work for "Block Page" but not for "Panels" pages which I guess makes sense since the title plugin is extending from: extends BlockDisplayVariant.

Does this mean we need to have completely separate plugins for title?

One for "Block Page" which is currently working and one for "Panels" which has yet to be created?

gambry’s picture

Issue tags: +Needs tests

Patch at #5 works, I'm assuming we should add test coverage?

I would open a followup for UX issue flagged at #10 "It is a bit confusing because the block settings has a title and a checkbox to show the title but that title isn't the one shown and checking the box causes it to show the title that is on the general tab twice."

#15 I don't use Panels, so I'm not sure what to reply. But probably opening another issue and coding the fix yourself is the best option.

gambry’s picture

Status: Needs review » Needs work

Setting back to Needs work for adding test coverage.

gambry’s picture

Additionally I've just found out page title is cached and don't invalidated correctly, so for instance anonymous users always see the same title for any page.
Apparently page_title_block doesn't have any URL related cache context.

Not sure if this is the right approach - otherwise let me know and I can post a patch - but manually adding a cache
context to the block_build works:

        if ($block instanceof TitleBlockPluginInterface) {
          $block_build['#cache']['contexts'][] = 'url.path';
        }
mrkdboyd’s picture

@sylus - There seems to be an issue over in Panels issue queue with a patch for the page title not displaying on "Panels" pages: #2869412: Page title does not display

ershov.andrey’s picture

Version: 8.x-1.x-dev » 8.x-4.x-dev
ershov.andrey’s picture

Assigned: Unassigned » ershov.andrey
ershov.andrey’s picture

Assigned: ershov.andrey » Unassigned
lamp5’s picture

Issue still exists, but patch from #5 does not work for me.

manuel.adan’s picture

@lamp5, #5 works for me testing on a D8.8 fresh install with standard profile. Review that you are using a "Block page" page variant, not panels, see the related issue #2869412: Page title does not display in panels.

Dru Pal’s picture

This is still an issue and not sure why it's happening. Page_title does not show up and I'm using Drupal 8.8. Also tried #5 patch and only got the white screen of death (WSOD). It just made things worse.