2

I created a new region in my Omega subtheme called MYTHEME-MENU. I want this region to do the same thing as the normal menu region, but with adding some markup. What is the proper way of doing this (I don't want to add the markup in Omega's region-menu.tpl.php file)?

I see I have a template, process and preprocess directories along with an empty template.php file, but I'm not sure how to use these.

Essentially my MYTHEME-MENU region needs to spit out the following:

<div<?php print $attributes; ?>>
   <div<?php print $content_attributes; ?>>
<span class="nav-bg"></span>
    <?php if ($main_menu || $secondary_menu): ?>
    <nav class="navigation">
    <?php print theme('links__system_main_menu', array('links' => $main_menu,
       'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 
       'clearfix',     'main-menu')), 'heading' => array('text' => t('Main 
        menu'),'level' => 'h2','class' =>     array('element-invisible')))); ?>
    <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu,
       'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 
       'inline', 'clearfix', 'secondary-menu')), 'heading' => array('text' => 
        t('Secondary menu'),'level' =>     'h2','class' => array('element-
        invisible')))); ?>
    </nav>
    <?php endif; ?>
    <?php print $content; ?>
    </div>
  </div>

migrated from stackoverflow.com Apr 25 '12 at 13:27

This question came from our site for professional and enthusiast programmers.

1

I'm trying to get a similar issue solved. In your case, I think you also need to have the region.tpl.php file in your custom templates folder also.

  • Adding the region.tpl.php file to my template directory fixed the problem. Thanks. – tmolhook Apr 25 '12 at 22:30
2

You don't need to create another region for that.

You just have to copy the Omega file omega/templates/region--menu.tpl.php to your subtheme's template folder: MYTHEME/templates/region--menu.tpl.php.

There you can make whatever changes you need.

  • I added a region--menu.tpl.php file in my theme's template directory, but the updates to the markup are not being reflected on the site. I also cleared the cache. Any ideas? – tmolhook Apr 25 '12 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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