Is it possible to hide the first sidebar on only one content type? The default layout for the site includes the first sidebar, but it's in the way on one particular content type and I'm looking for a way to hide it.

Thanks for any advice or suggestions.

Comments

Deepika.chavan’s picture

Hi,
Try this out,
1. In template.php enable YOURTHEME_preprocess_page(&$vars, $hook) function.
Under that function add following code :

if ($vars['node']->type == 'dance_type'){
    $vars['template_files'][] = "page-dance_type";
}

NOTE: Here my content type is 'dance_type'. Please replace it with yours.

2. Take a copy of page.tpl.php (if page.tpl.php is not there copy it from zen/templates/. )and rename it as 'page-dance_type.tpl.php' .
3. Open 'page-dance_type.tpl.php' i.e. newly created template file and remove following code :

<?php print $sidebar_first; ?>

4. Add following css :

body.node-type-dance-type #content {
margin-left:0;
margin-right:-760px;
width:760px;
}

5. Please clear cached data here- admin/settings/performance.

HTH!!

Rgrds,
Deepika Chavan.

camhoward’s picture

Status: Active » Closed (fixed)

Hi Deepika,

Thanks very much for your clear directions. They work perfectly!

Much appreciated,
Cam

nikitavermajgd’s picture

thanks Deepika.chavan
Works fine!!