Created
September 4, 2012 15:38
-
-
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
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_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