Hello there,

First of all, I'm loving this theme, thanks for all the work. I'm making little changes to adapt it and customize it a bit, but just to have something different ;)

So, I'm having problems to make the pimary-content when the sidebar is empty. I'm using the Two Columns (Main + Right Sidebar) layout, and what I'm trying is to have no sidebar in the forums pages, so the forums use full width getting better readability.

I have hidden all the blocks for the forum pages, and for the searchbox and sidebar I have done this changes in page.tpl.php:

<div id="sidebar">
				<?php
				if ($node->type != "forum") :
				?>
				<div class="block block-theme"><?php print $search_box ?></div>
                <?php
				endif;
				?>
                <div class="blocks">
                  <?php print $right ?>
                </div>
              </div>

At some point I hade the searbox hidden in forum pages (right now seems to not be working), bit even then or if I don't show the searchbox at all the prymary contents still don't expand, leaving a big white space.

I understand that some changes have to be done in style.css, but I have tried giving #primary-content a 100% width and still doesn't work. May be I'm not properly understing this part of the CSS, or maybe some more changes are needed.

/* default widths */
#primary-content{width:630px;}
#sidebar{width:310px;}
#sidebar2{width:230px;}

/* col-1 */
body.col-1 #primary-content{width:940px;left:0;}
body.col-1 #sidebar, body.col-1 #sidebar2{display:none;}

/* col-2-left */
body.col-2-left #primary-content{left:310px;}
body.col-2-left #sidebar{left:-630px;}
body.col-2-left #sidebar2{display:none;}

/* col-2-right, default */
body.col-2-right #primary-content{left:0;}
body.col-2-right #sidebar{right:0;}
body.col-2-right #sidebar2{display:none;}

/* col-3 */
body.col-3 #primary-content{left:230px;width:480px;}
body.col-3 #sidebar{right:0px;width:230px;}
body.col-3 #sidebar2{left:-480px;}

/* col-3-left */
body.col-3-left #primary-content{left:460px;width:480px;}
body.col-3-left #sidebar{left:-710px;width:230px;}
body.col-3-left #sidebar2{left:-250px;}  /* gs - s1 - (s1+s2) */
body.col-3-left #primary-content .blocks{margin-left:10px;}

/* col-3-right */
body.col-3-right #primary-content{left:0;width:480px;}
body.col-3-right #sidebar{left:0;width:230px;}
body.col-3-right #sidebar2{left:0;}
body.col-3-right #primary-content .blocks{margin-right:10px;}

Could someone please help me to get this to work? With all the themes I ahve used in Drupal expanding the primary content was kind of automatic, so I can't understand why it's being so hard for me this time.

Thanks a lot!

Comments

Yannick WEBER’s picture

Hi dresde,

I've the same problem that you.

In my case, It's a real problem for many thinks.

I'm working on it since 1h.

If I provide it, I'll post my solution.

If you or any one find a solution, please post it.

The theme is build on a table structure, I find it's much more difficult to modify.

dresde’s picture

Hello RedKing,

Thanks to the people in Drupal Hispano I found a solution. The thing is:

1- create a custom page-forum.tpl.php file, in the theme's folder. If the content type you are working with is different, create a different template

2- change the "body class" to the one that works for you. You can check the different "options" from the theme if you change the theme configuration, visit your homepage and then check the code with the browser. In the page-tpl.php file reads

  <body class="<?php print $body_classes?> browser-gecko">

In my case, to get the main content expanded, I changed it to

  <body class="not-front not-logged-in page-forum no-sidebars blog fixed col-1  browser-gecko">

3- and now comes the magic. Download and install the module Node Page Template (http://drupal.org/project/node_page). Now, go to the content type and change the template it should use. In my case, from the default to the page-forum.tpl.php.

And done :)

Yannick WEBER’s picture

Hi dresde,

It's working very well

Thank's

livewire1337’s picture

hey guys, just saw this and thought i would post my fix, doesnt require any other modules or anyhting, just adding 2 new rules to the css file.

I am using the fixed style so i added the follwing 2 rules to my fixed.css file:

body.col-2-right.no-sidebars #primary-content {
  width: 940px;
}

body.col-2-right.no-sidebars #sidebar {
   display: none;
}

This will make it so that the content auto expands when there are no sidebars on the page. :D

hope this helps you guys :D

kiwipearls’s picture

Thank-you so much for this.

I've spent all day trying to figure out how to make a page use up the space where the sidebar should be.

Everything on my site looks pretty now.

but...I wish I knew how to create a custom style for my personal blog, so it looks different to the other user blogs on my site...hmmmmm

calebm12’s picture

thanks livewire. spent a good hour trying to find out how to do that.
now if i could just figure out how to make the admin tables (manage fields) resize to fit when there is a sidebar present.