Hi again,

I would like to use the 2 sidebars on front page but only the right one on content pages ; the left sidebar would collapse so that content would take up the left part of screen (75 % wide). Would it be possible ?

(beautiful theme, indeed... thanks !)

CommentFileSizeAuthor
#6 ninesixtyrobots_collapsible.patch1.66 KBquicksketch

Comments

DerTobi75’s picture

Hi,

this feature would be really great! Any chance to get this done?

Regards,

Tobi

jjeff’s picture

I take a crack at this when I get a chance.

In the meantime, if anyone wants to submit a patch, I think this would be a great feature to get in.

frankydp-1’s picture

I have a fix for this that requires a change to page.tpl

This change will make it "pseudo" float right. Not really changing the float but expanding the main div if sidebar-left is not populated.

You could probably write an if statement straight into the class id of one copy of the main div, would be cleaner.

Double check my code I might have changed something else small to facilitate formatting and styling for myself.

page.tpl.php

Original code.

<!-- main -->
      <div id="main" class="grid_8">
        <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
        <?php if (!empty($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
        <?php if (!empty($messages)): print $messages; endif; ?>
        <?php if (!empty($help)): print $help; endif; ?>
        <div id="content-output"> 
          <?php print $content; ?>
        </div><!-- /#content-output -->
      </div>
      <!-- main ends here -->

      <!-- sidebars starts here -->
      <div id="sidebars" class="grid_8">

        <!-- left sidebar starts here -->
        <div class="grid_4 alpha sidebar-left">
          <?php print $left; ?>
        </div>
        <!-- left sidebar ends here -->

        <!-- right sidebar starts here -->
        <div class="grid_4 omega sidebar-right">
          <?php print $right; ?>
        </div>
        <!-- right sidebar ends here -->

      </div>
      <!-- sidebars end here -->

Replacement

<!-- main -->
      
      <?php if (empty($left)): ?>
      <div id="main" class="grid_11">
        <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
        <?php if (!empty($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
        <?php if (!empty($messages)): print $messages; endif; ?>
        <?php if (!empty($help)): print $help; endif; ?>
        <div id="content-output"> 
          <?php print $content; ?>
        </div><!-- /#content-output -->
      </div>
      <?php endif; ?>
      
      <?php if (!empty($left)): ?>
      <div id="main" class="grid_8">
        <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
        <?php if (!empty($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
        <?php if (!empty($messages)): print $messages; endif; ?>
        <?php if (!empty($help)): print $help; endif; ?>
        <div id="content-output"> 
          <?php print $content; ?>
        </div><!-- /#content-output -->
      </div>
      <?php endif; ?>
      
      
      <!-- main ends here -->

      <!-- sidebars starts here -->
      <div id="sidebars" class="">
		
        <!-- left sidebar starts here -->
        <div class="grid_4 alpha sidebar-left">
          <?php print $left; ?>
        </div>
        <!-- left sidebar ends here -->
     	
        <!-- right sidebar starts here -->
        <div class="grid_4 omega sidebar-right">
          <?php print $right; ?>
        </div>
        <!-- right sidebar ends here -->

      </div>
      <!-- sidebars end here -->
kirin’s picture

Hey, this worked great!

Nice work, man. Thanks. Now both my admin section and my forums section don't have column-breaking going on.

quicksketch’s picture

Title: collapsible sidebars » Make sidebars collapse when empty
Version: 6.x-1.0 » 6.x-2.0-beta3

I'm working on fixing this in a more permanent manner. Thanks frankydp for your suggestion!

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.66 KB

I've committed the attached patch which makes both sidebars optional, the layout should expand as needed with one, two, or no sidebars.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.