<?php
/**
* This code snippet is used to show selected node content
* in the block based on the current node id. The idea is
* to show relevant sidebar content that matches up with the
* main content. One block instead of several.
*
* If logged in user has admin nodes then show an Edit link.
*/
if ( arg(0) == "content" || arg(0) == "node" )
{
//Choose which node to put into the block
switch (arg(1))
{
case "10": //nid of the home page
$xNode = 58; //nid of content to load
break;
case "about": //this page is a view made with Views module so no nid
$xNode = 59;
break;
case "40":
$xNode = 69;
break;
default:
return FALSE;
}
$node = node_load($xNode);
//Add an edit link for admins
if (user_access('administer nodes'))
{
$nodeurl = url('node/'. $node->nid);
print('<a href="'.$nodeurl.'">[edit]</a>');
}
$nodeout = node_view($node);
print $nodeout;
}
/* // Helpful debugging info.
$x=arg(0);
$y=arg(1);
$z=arg(1);
print "<p>x=$x<br />y=$y<br />z=$z</p>";
// ==End Debug== */
?>
‹ Simple book-like navigation using menu itemsupAggregator headline display with date ›