The current 2.x version with the Zone methodology is printing out all the zones, regardless of if there are regions rendered inside it or not...

This is happening because in the default zone.tpl.php

<?php if($enabled): 

if($wrapper):

print $zid;-outer-wrapper" class="clearfix"> endif;
print $classes; " print $attributes;>
print render($regions);

if($wrapper):

endif;
endif;
?>

There is no current check in hook_preprocess_zone or hook_process_zone that sets a flag to see if there IS actually content...

I think the best option here will be to use element_children during the zone process hooks, and if there ARE in fact set another variable such as $populated to include in zone.tpl.php like such:

<?php if($enabled && $populated): 

if($wrapper):

print $zid;-outer-wrapper" class="clearfix"> endif;
print $classes; " print $attributes;>
print render($regions);

if($wrapper):

endif;
endif;
?>

Fairly simple fix, but WILL required editing any customized zone templates in order to implement the fix one I have applied this to the process functionality for zones.

Comments

himerus’s picture

Category: bug » task
Status: Active » Closed (won't fix)

FML... can't edit original issue, and using php tags with the tpl code made it look horrible... will open a new issue and use code tags instead... WTF

himerus’s picture

Assigned: himerus » Unassigned