0

I'm using Omega, and have 6 regions in a particular zone. The first and second region span the width of the zone with 12 columns, and the other 4 are 1/4 in-line blocks. I want to set the background for the 4 in-line blocks to a particular color. How can I wrap those 4 regions inside a div so I can set the background color?

1 Answer 1

1

How can I wrap those 4 regions inside a div so I can set the background color?

You can use .tpl files for that.

<?php if ($region_first || $region_second): ?>
    <div class="your_color_class">

        <?php if ($region_first): ?>
            <div id="region_first">
                <?php print $region_first; ?>
            </div>
        <?php endif; ?>

        <?php if ($region_second): ?>
            <div id="region_second">
                <?php print $region_second; ?>
            </div>
        <?php endif; ?> 

    </div>
<?php endif; ?> 
3
  • No way to do this in pre-process?
    – vintorg
    Jun 5, 2013 at 23:48
  • You can use preprocess function to add a css class to regions, it's ok, but if you need to add some html you ought to use .tpl files - that's what they are for. There is no way to wrap several or even one region in div with preprocess function. At most you can wrap the content, but not the entire region.
    – Jack-PL
    Jun 6, 2013 at 12:19
  • I see. To stay in proper flow, I should probably create a new zone for those regions.
    – vintorg
    Jun 6, 2013 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.