function nodesymlinks_page in NodeSymlinks 6
Same name and namespace in other branches
- 7 nodesymlinks.module \nodesymlinks_page()
Menu callback which loads and displays the content from the node wrapped within the different menu and breadcrumbs. It also sets the robots META tag to prevent duplicate search engine indexing.
Parameters
node $node:
mlid $mid:
Return value
HTML
1 string reference to 'nodesymlinks_page'
- nodesymlinks_menu in ./
nodesymlinks.module - Implementation of hook_menu().
File
- ./
nodesymlinks.module, line 104 - Node Symlinks allows creating duplicate menu links with unique id to all nodes. As a result all these duplicates have unique menu trails and breadcrumbs.
Code
function nodesymlinks_page($node, $mid) {
// don't allow duplicates to be indexed
if (!drupal_is_front_page()) {
drupal_set_html_head('<meta name="robots" content="noindex, follow">');
}
$output = '';
if (node_access('update', $node)) {
$output .= theme('nodesymlinks_edit_links', $node->nid);
}
// View as a full page.
if (module_exists('page_manager')) {
// If there exists another handler for the node view use it, otherwise
// fallback on the drupal core node view.
include_once drupal_get_path('module', 'page_manager') . '/plugins/tasks/node_view.inc';
$output .= page_manager_node_view($node);
}
else {
// Use the drupal core handler for a node view.
$output .= node_view($node, FALSE, TRUE, FALSE);
}
// Create breadcrumb based on the menu path.
// NOTE: Setting breadcrumb *after* node_view() prevents our breadcrumbs to
// be changed in some other module.
drupal_set_breadcrumb(nodesymlinks_get_breadcrumbs());
drupal_set_title($node->title);
return $output;
}