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
Comments 2
Make sure you enclose this piece of code in the php brackets (< ?php, ?>) or it wont work.
Posted 29 Mar 2007 at 3:27 pm ¶A popular bar had a new robotic bartender installed. A guy came in for a drink and the robot asked him, “What’s your IQ?” The man replied, “130.” So the robot proceeded to make conversation about physics, astronomy, and so on. The man listened intently and thought, “This is really cool.” Another guy came in for a drink and the robot asked him, “What’s your IQ?” The man responded, “120.” So the robot started talking about the super bowl, dirt bikes, and so on. The man thought to himself, “Wow, this is really cool.” A third guy came in to the bar. As with the others, the robot asked him, “What’s your IQ?” The man replied, “80.” The robot then said, “So, how are things in Alabama these days?”
Posted 09 Feb 2009 at 4:39 am ¶Post a Comment