We recently completed a site that had loads of different templates and a very 'tight' design, specifically when it came to vertical spacing and grids.
As we were trying to wrangle out spacing issues we kept noticing vertical space that appeared to be coming from nowhere.

We eventually tracked the blank space down to the node bottom region, whos wrapper is rendered even when node bottom itself is empty.
I was wondering why the wrapper doesn't sit inside a conditional for the region?
Is it so it could be used to add graphics/background images - custom rounded corners for example - that could wrap node content.

Comments

sheena_d’s picture

Status: Active » Fixed

the conditional for the node_top and node_bottom regions is based on whether or not the node is displayed as a teaser or full node. If you want to hide the regions' wrapping divs when the regions are empty, you can add a check for the region to the page.tpl.php file.

Change the following chunk of code:

<?php if (!$teaser): ?>
    <div id="node-top" class="node-top region nested">
      <?php print render($node_top); ?>
    </div>
  <?php endif; ?>

to match this:

<?php if (!$teaser && $node_top): ?>
    <div id="node-top" class="node-top region nested">
      <?php print render($node_top); ?>
    </div>
  <?php endif; ?>

And then repeat for the node_bottom region.

hixster’s picture

Hi Sheena, thanks for that, I understand how to make the wrappers conditional, my question was more to do with why they are not conditional by default.
Is there a purpose to the wrapper being printed even when empty?

hixster’s picture

any thoughts on this?

hixster’s picture

Status: Fixed » Active

Changing status

hixster’s picture

still no solution to this - node bottom is appearing in our pages even though there is no content in it which causes unnecessary spacing issues.
See attachments in next post...

Update - this is wrong actually, Sheena did post the solution above, I'm still curious as to why this is like this.
There doesn't seem to be any reason to print empty regions.

hixster’s picture

Attachments...

joulymask’s picture

Sheena_d can you explain ' if (!$teaser): ' this part I am not getting the condition :/ sorry for silly question :/

--------------------------------------------------
http://www.timeology.net/

getmensuit’s picture

I am also waiting for it !

hixster’s picture

waiting for what exactly?

webkenny’s picture

Status: Active » Closed (duplicate)

This is actually a duplicate of #1772370: Fusion prints empty regions for no reason which has a patch ready for you to test and provide feedback on. :) We'll commit once we get a few folks testing it.

hixster’s picture