Skip to content

Instantly share code, notes, and snippets.

@pixelwhip
Created September 4, 2012 15:38
Show Gist options
  • Select an option

  • Save pixelwhip/3622533 to your computer and use it in GitHub Desktop.

Select an option

Save pixelwhip/3622533 to your computer and use it in GitHub Desktop.
Hides the default page title on nodes where the title is set as a field via Display Suite
/**
* Implements hook_process_page.
*/
function sipk_process_page(&$variables) {
// Remove the title from pages that have been set with Display Suite.
$content = $variables['page']['content'];
// Check to see if this is a node page.
if (isset($content['system_main']['nodes'])) {
// Grab the node render array.
$node = array_shift($content['system_main']['nodes']);
// Check to see if the node title is set as a field.
if (isset($node['title'])) {
// Remove the title.
$variables['title'] = "";
}
}
} //sipk_process_page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment