Hi,

I have a simple site to build using Omega 4. One layout has no sidebars and a full width feature zone. The other does not have the feature zone, but does have a sidebar. I can achieve this with just one template by checking if empty in my 'one-sidebar-layout.tpl.php' i.e.

  <?php if (!empty($page['feature'])): ?>
    <div class="l-feature-wrapper">
      <?php print render($page['feature']); ?>
    </div>
  <?php endif; ?>

**AND**

  <?php if (!empty($page['sidebar_first'])): ?>
    <?php print render($page['sidebar_first']); ?>
  <?php endif; ?>

Or I could make two templates. But would having two templates that both contain a header and a footer mean that I would then need to add the main menu (via context) to both of these templates in order to render it sitewide. If that makes sense!?

What would you say would be the desired method?

Thanks.

Comments

msmithcti’s picture

Firstly, I assume you are talking about "regions" when you say "zones", zones are a hangover from Omega 3 whereas Omega 4 uses the plain old Drupal regions.

If you take a look at the simple layout in Omega 4 you will see something very similar, where the sidebars are conditional and the CSS handles all combinations of sidebars/no sidebars. You just have to make the call when this becomes so complex that it's difficult to maintain, and then you split things out into multiple templates (Omega 4 layouts would be the suggested way of doing this).

samwillc’s picture

Hi, I've been studying the simple layout and ohm theme all day and it's making more sense now. I've got a custom theme going and just going to use conditional as the layout is really very simple. I did mean regions when I talk about zones.

Thanks for the info.

fubhy’s picture

Status: Active » Fixed

So I guess this is fixed then?

samwillc’s picture

Yes, can mark as fixed, thanks.

Status: Fixed » Closed (fixed)

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