Hello,

By default, fusion theme has a region called "Preface bottom" which is placed over content only and second sidebar only. I would like to change it in order that this region would be moved to the left, so it would be placed over first sidebar and content but NOT over second sidebar (just like this: http://drupal.org/files/issues/regions_3.png).

I copied fusion's page.tpl.php to my subtheme folder so I can change where this region is printed but unfortunately I don't succeed with it.

Can anyone help me with this?

Thank you

Can

Comments

c-c-m’s picture

Status: Fixed » Active

I'll post the solution provided by Sheena_d at IRC Channel which has been both helpful and useful. Hopefully it will help others in the future, as much as it has helped me:

1. First step is to move the sidebar first region. Copy page.tpl.php from Fusion core into your theme, or edit the page.tpl.php file already in your theme.

//Currently, sidebar first is printed out in this context:

       <div id="main-wrapper" class="main-wrapper full-width">
            <div id="main" class="main row <?php print $grid_width; ?>">
              <div id="main-inner" class="main-inner inner clearfix">
                <?php print theme('grid_row', $sidebar_first, 'sidebar-first', 'nested', $sidebar_first_width); ?>
     
                <!-- main group: width = grid_width - sidebar_first_width -->
                <div id="main-group" class="main-group row nested <?php print $main_group_width; ?>">
                  <div id="main-group-inner" class="main-group-inner inner">
                    <?php print theme('grid_row', $preface_bottom, 'preface-bottom', 'nested'); ?>
                   
                    <div id="main-content" class="main-content row nested">
                      <div id="main-content-inner" class="main-content-inner inner">
     

//Move the line of code that prints sidebar-first, so that the chunk of code is now organized like this:

          <div id="main-wrapper" class="main-wrapper full-width">
            <div id="main" class="main row <?php print $grid_width; ?>">
              <div id="main-inner" class="main-inner inner clearfix">    
     
                <!-- main group: width = grid_width - sidebar_last_width -->
                <div id="main-group" class="main-group row nested <?php print $main_group_width; ?>">
                  <div id="main-group-inner" class="main-group-inner inner">
                    <?php print theme('grid_row', $preface_bottom, 'preface-bottom', 'nested'); ?>
                       
                    <div id="main-content" class="main-content row nested">
                      <div id="main-content-inner" class="main-content-inner inner">
                             <?php print theme('grid_row', $sidebar_first, 'sidebar-first', 'nested', $sidebar_first_width); ?>

2. The second step is to move the sidebar-last region.

//Currently, sidebar last is printed out in this context:

                            <?php print theme('grid_row', $content_bottom, 'content-bottom', 'nested'); ?>
                          </div><!-- /content-group-inner -->
                        </div><!-- /content-group -->
     
                        <?php print theme('grid_row', $sidebar_last, 'sidebar-last', 'nested', $sidebar_last_width); ?>
                      </div><!-- /main-content-inner -->
                    </div><!-- /main-content -->
     
                    <?php print theme('grid_row', $postscript_top, 'postscript-top', 'nested'); ?>
                  </div><!-- /main-group-inner -->
                </div><!-- /main-group -->
              </div><!-- /main-inner -->
            </div><!-- /main -->
          </div><!-- /main-wrapper -->
     

//Move the line of code that prints sidebar-last, so that the chunk of code is now organized like this:

                            <?php print theme('grid_row', $content_bottom, 'content-bottom', 'nested'); ?>
                          </div><!-- /content-group-inner -->
                        </div><!-- /content-group -->
                       
                      </div><!-- /main-content-inner -->
                    </div><!-- /main-content -->
     
                    <?php print theme('grid_row', $postscript_top, 'postscript-top', 'nested'); ?>
                  </div><!-- /main-group-inner -->
                </div><!-- /main-group -->
             <?php print theme('grid_row', $sidebar_last, 'sidebar-last', 'nested', $sidebar_last_width); ?>
             </div><!-- /main-inner -->
            </div><!-- /main -->
          </div><!-- /main-wrapper -->

3. The last step is to add the following code to your template.php file. This reverses the way the preface bottom and postscript top widths are calculated. Create a blank file in your subtheme's root folder, name it template.php and paste the following function:

    function MYTHEME_preprocess_page(&$vars) {
     
    /*Altering the way Fusion usually calculates grid widths for preface and postscript regions so that sidebar-first clears preface and postscript regions*/
      $grid_name = substr(theme_get_setting('theme_grid'), 0, 7);
      $grid_type = substr(theme_get_setting('theme_grid'), 7);
      $grid_width = (int)substr($grid_name, 4, 2);
      $sidebar_first_width = ($vars['sidebar_first']) ? theme_get_setting('sidebar_first_width') : 0;
      $sidebar_last_width = ($vars['sidebar_last']) ? theme_get_setting('sidebar_last_width') : 0;
      $vars['main_group_width'] = $grid_name . ($grid_width - $sidebar_last_width);
      // For nested elements in a fluid grid calculate % widths & add inline  
     
    }

c-c-m’s picture

Status: Active » Fixed

Status: Active » Closed (fixed)

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

mshepherd’s picture

Version: 6.x-1.0-rc1 » 7.x-2.x-dev
Status: Closed (fixed) » Active

*** this isn't correct at the moment
*** I'll update once fixed

The process for Fusion 2 on Drupal 7 is similar for the page.tpl.php file, but you'll be looking for render() functions instead of theme() functions. And sidebar_second instead of sidebar_last.

The changes in template.php aren't relevant, but make these changes to your theme.info file:

Change 1

which calculates the preface_bottom width. It would have been full width - sidebar_first width and this needs changing to full width - sidebar_second width.

settings[grid_adjusted_regions][preface_bottom][] = sidebar_first
change to:
settings[grid_adjusted_regions][preface_bottom][] = sidebar_second

Change 2

which replaces sidebar_first with sidebar_second in the main group.

settings[grid_adjusted_groups][main_group][] = sidebar_first
change to:
settings[grid_adjusted_groups][main_group][] = sidebar_second

Perhaps someone from topnotch could confirm this?

esmerel’s picture

Status: Active » Closed (fixed)

things that are accurate for 6.x have a very good chance of not being accurate for 7.x, especially when the theme itself has undergone a major change - please do not reopen issues that have been closed for a previous major release.

sheena_d’s picture

Version: 7.x-2.x-dev » 6.x-1.0-rc1