News arrow Magazine arrow Tutorials arrow [4.0] Hiding the right blocks
[4.0] Hiding the right blocks Print E-mail
Written by Arthur Konze   
Monday, 17 February 2003

A very common question which i'm asked is how to hide the right blocks on content pages. Naturally Mambo don't hide the complete right block. Only within a few components like the poll the admin can change if this modules block should be displayed on certain pages.

Hiding the complete right block is pretty easy. I'm using the "option" variable to let my themes know, on which page we are. This could be integrated very simple. Get your theme and search for the integration of the right block. It should look like this:

<?php
  $side = "right";
  include ("component.php");
?>

Just replace this with the following code:

<?php
  switch ($option){
    case "news":
    case "articles":
    case "weblinks":
    case "faq":
    case "displaypage":
    case "contact":
      echo "<!-- No Sidebar -->";
    break;

    default:
      $side = "right";
      include ("component.php");
  }
?>

Now your theme check the page the user is currently viewing and hides the right block or not depending on the pages you integrated in the "case" list. If you delete every case except of the articles, the right block will only be hidden on article pages. If you add a case for "Downloads" also the filebase won't show you any right block.

 
Tag Cloud

announced   another   backend   beta   bug   category   code   community   component   components   core   database   development   directory   display   downloaded   editor   forums   grab   links   mambo   mamboportal   mambot   manager   module   modules   mos   official   phil   preview   project   robert   simpleboard   source   template   templates   upcoming   update   using   working   451  

Created with AkoCloud 1.1 final.