How would I go about removing the sidebar from only certain pages? There are some pages I want it displayed on but not others.

Comments

nevets’s picture

The first is to control the visibility of all the blocks in the sidebar. One approach is to wriite a function, sidebar_visible() and place it in template.php. For each block then you use php for visibility and return sidebar_visible(). The function simple returns TRUE if the sidebar should be visible, FALSE otherwise. In general the function looks at the path and determines if it should return TRUE or FALSE.

Another approach is to build the path checking code into page.tpl.php and hide/show the sidebar as needed.

This assumes the theme you are using will work correctly with the sidebar hidden/not displayed.

jsimonis’s picture

An even easier way is to tell the blocks that are in that sidebar not to show up on the pages where you want the sidebar to disappear. (I use this most often on pages like the calendar, access permissions, etc. - any page that needs to be wider.

If you remove all the blocks from those pages, the sidebar disappears.

To make that change, go to the admin section, then click on the blocks link. There under "configure" you can change what pages a block does/doesn't show up on.

This keeps you from having to do any custom coding. Just remember anytime you add new blocks to that sidebar that you go in and configure them not to show up either.

--
Jenni S.
http://www.nu-look.net
Portland, OR metro area
Contact Me