Skip to content

Instantly share code, notes, and snippets.

@anthonyringoet
Created April 4, 2012 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyringoet/2300059 to your computer and use it in GitHub Desktop.
Save anthonyringoet/2300059 to your computer and use it in GitHub Desktop.
cleanup panels-twocol-bricks.tpl.php markup
<?php
/**
* cleanup this mess by checking if something exists before printing all the markup surrounding it.
*/
?>
<div class="panel-display panel-2col-bricks " <?php if (isset($css_id)) { print "id=\"$css_id\""; } ?>>
<?php if(!empty($content['top'])): ?>
<div class="panel-panel panel-col-top">
<?php print $content['top']; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['left_above']) || !empty($content['right_above']) || !empty($content['middle'])): ?>
<div class="center-wrapper">
<?php if(!empty($content['left_above'])): ?>
<div class="panel-panel panel-col-first">
<?php print $content['left_above']; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['right_above'])): ?>
<div class="panel-panel panel-col-last">
<?php print $content['right_above']; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['middle'])): ?>
<div class="panel-panel panel-col-middle">
<?php print $content['middle']; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['left_below']) || !empty($content['right_below']) || !empty($content['bottom'])): ?>
<div class="center-wrapper">
<?php if(!empty($content['left_below'])): ?>
<div class="panel-panel panel-col-first">
<?php print $content['left_below']; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['right_below'])): ?>
<div class="panel-panel panel-col-last">
<?php print $content['right_below']; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if(!empty($content['bottom'])): ?>
<div class="panel-panel panel-col-bottom">
<?php print $content['bottom']; ?>
</div>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment