summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/node/node.module7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index d74c1ce9e..ec9700c4e 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1876,6 +1876,10 @@ function node_menu() {
);
}
$items['node/%node'] = array(
+ 'title callback' => 'node_page_title',
+ 'title arguments' => array(1),
+ // The page callback also invokes drupal_set_title() in case
+ // the menu router's title is overridden by a menu link.
'page callback' => 'node_page_view',
'page arguments' => array(1),
'access callback' => 'node_access',
@@ -2502,6 +2506,9 @@ function node_page_default() {
* Menu callback; view a single node.
*/
function node_page_view($node) {
+ // If there is a menu link to this node, the link becomes the last part
+ // of the active trail, and the link name becomes the page title.
+ // Thus, we must explicitly set the page title to be the node title.
drupal_set_title($node->title);
$uri = entity_uri('node', $node);
// Set the node path as the canonical URL to prevent duplicate content.