Code snippet that can be used to remove title block for a certain page in Drupal 8.
/** * Implements hook_block_view_alter(). */ function mymodule_block_view_alter(array &$build, DrupalCoreBlockBlockPluginInterface $block) { if ($block->getBaseId() === 'page_title_block') { // Remove the title block from the front page. $is_front = Drupal::service('path.matcher')->isFrontPage(); if ($is_front) { $build['#access'] = FALSE; } } }
Similar Posts:
- How to remove title block for a certain page in Drupal 8
- How to create custom block in Drupal 8 programmatically
- how to add bootstrap readmore button to teaser in drupal 8
- Drupal: Creating a Computed Entity Field
- Helpful node methods in Drupal 8
773