Drupal: Hide Navigation on Forum
Pete
If you want to hide certain Navigational Blocks on your Drupal sites forum(s) here’s how to do it:
1. Go to "Administer » Blocks"
2. Click "configure" on the block you want to hide.
3. On Page specific Visibility Settings click the option for "Show if the following PHP code returns TRUE"
4. Enter the following code in the text area:
PHP:
-
if (arg(0) == 'node')
-
{
-
return $node->type != 'forum';
-
}
-
elseif (arg(0) == 'forum')
-
{
-
return false;
-
}
-
else
-
{
-
return true;
-
}
-
?>
This will hide the navigation on the forum hompage, when viewing lists of topics and when viewing individual posts (nodes).
# Pete Graham
Posted in Tech, Website Development, php, drupal |
14 Comments »