Created
May 3, 2012 20:36
-
-
Save robballou/2589066 to your computer and use it in GitHub Desktop.
custom_content_pages example page callback #1
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
<?php | |
function custom_content_pages_about() { | |
// load our content: since our path starts with the alias for this | |
// node, we can lookup the node source that way | |
$node_path = drupal_lookup_path('source', arg(0) .'/'. arg(1)); | |
// now we can the actual node | |
$node = menu_get_object('node', 1, $node_path); | |
// set the title | |
drupal_set_title('About'); | |
// update the breadcrumb | |
$breadcrumb = drupal_get_breadcrumb(); | |
array_push($breadcrumb, '<a href="/'. arg(0) .'">Content</a>'); | |
array_push($breadcrumb, '<a href="/'. arg(0) .'/'. arg(1) .'">'. $node->title .'</a>'); | |
drupal_set_breadcrumb($breadcrumb); | |
// return the content for the page | |
return array( | |
'content' => array( | |
'#markup' => $node->field_about[$node->language][0]['safe_value'], | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment