Hello

I am trying to hide a page title block on one content type. I checked all other content types in block settings, it works, but now there is no title on pages like "/user" or on empty start page.

Comments

juves created an issue. See original summary.

markhalliwell’s picture

Version: 8.x-4.x-dev » 8.x-3.x-dev
Status: Active » Closed (duplicate)
Related issues: +#2887071: Page title block settings removes pages titles from views pages and group pages

This is not a bug. Please see the related issue above.

juves’s picture

Thank you.

Solved this with theme_preprocess_page_title() in *themename*.theme

function *themename*_preprocess_page_title(&$variables) {
  $node = \Drupal::routeMatch()->getParameter('node');
  if( $node && $node->getType() == '*content_type*' ) {
      $variables['title'] = "";
  }
}