Created
June 15, 2021 17:44
-
-
Save jeremycaldwell/14e3d93554d38bd093b5bf4680372ee8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess_HOOK() for page title templates. | |
*/ | |
function THEMENAME_preprocess_page(&$variables) { | |
$node = \Drupal::request()->attributes->get('node'); | |
if (isset($node) && $node instanceof Node) { | |
// Check node types and remove the block title. | |
switch ($node->getType()) { | |
case "bio": | |
case "form": | |
case "page": | |
case "product": | |
case "product_subpage": | |
case "static_page": | |
case "support_download_page": | |
unset($variables['page']['title']); | |
break; | |
} | |
} | |
// Unset the page title for webform thank you pages. | |
$route_id = \Drupal::routeMatch()->getRouteName(); | |
if ($route_id === 'sophos_webform_confirmation.confirmation') { | |
unset($variables['page']['title']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment