Wondering how to remove the Sidebar Right region on a page that I will be using for my gallery (so I have more space for the gallery). I have cleared all the blocks, but still the region stays. I have spent hours on trying to figure this out (I'm really new and don't know any coding). I believe the correct way to do this is a condition statement that will prevent printing the sidebar if the page is the gallery. Can anyone help?

Comments

Deepika.chavan’s picture

Hi,
I tried the same thing on my local site.
1. In page.tpl.php, code is there to print 'Network connect' block . So to remove the block code from page.tpl.php I replaced following code :

<div id="right" class="clearfix">
            <div class="block">
                <h2>Network Connect</h2>  
                <div class="network">
                    <a href="http://twitter.com/morethanthemes" class="twitter">Twitter</a>
                    <a href="http://www.facebook.com/pages/More-than-just-themes/194842423863081" class="facebook">Facebook</a>
                    <a href="http://www.flickr.com/photos/56103643@N07/" class="flickr">Flickr</a>
                    <a href="#" class="in">In</a>
                    <a href="#" class="tumblr">Tumblr</a>
                    <a href="http://www.youtube.com/morethanthemes" class="youtube">Youtube</a>
                </div>
            </div>
            <?php print render($page['sidebar_first']); ?>
        </div><!--right-->

with the following:

<?php if($page['sidebar_first']): ?>
      <div id="right" class="clearfix">
           <?php print render($page['sidebar_first']); ?>
      </div><!--right-->
<?php endif; ?>

2. Created new block named 'Network Connect' and added following code in block body with full html filter.

<div class="network"  style=" padding:0 0;"><a href="http://twitter.com/morethanthemes" class="twitter" style="float: left;">Twitter</a><a href="http://www.facebook.com/pages/More-than-just-themes/194842423863081" class="facebook" style="float: left;">Facebook</a><a href="http://www.flickr.com/photos/56103643@N07/" class="flickr" style="float: left;">Flickr</a><a href="#" class="in" style="float: left;">In</a><a href="#" class="tumblr" style="float: left;">Tumblr</a><a href="http://www.youtube.com/morethanthemes" class="youtube" style="float: left;">Youtube</a> </div>

-- Now we can control the display of this block by selecting option 'All pages except those listed'.

-- Because of <?php if($page['sidebar_first']): ?> condition if the block is there then only it will display the 'right' region.

3. Added following css code in custom css file if no block is enabled in 'Sidebar First' region.

.no-sidebars #main-area-inside {
  background: #FFFFFF;
  width: 100%;
}

.no-sidebars #main-area-inside #main {
  width: 100%;
  border: 1px solid red;
}

4. Please clear cached data.
HTH !!

Rgrds,

Deepika Chavan.

gtsopour’s picture

Title: Removing Sidebar Right Region on Certain Pages » Removing sidebar for empty "sidebar_first" region
Assigned: larspeterson » gtsopour
Category: task » feature
Status: Active » Closed (fixed)
Issue tags: +Bluemasters theme, +bluemasters

Hello larspeterson,

Firstly, I would like to thank once again Deepika Chavan for her great support. I appreciate her effort.

Also, I would like to inform you that i have already embedded/committed the changes to the style.css and page.tpl.php files and will be included in next Bluemasters version 7.x-1.2, which is currently being prepared.

Only with a small diff in style.css

.no-sidebars #main-area-inside { background: #ffffff; }

.no-sidebars #main-area-inside #main { width: 870px; }

Thanks again
/George