How to edit a custom region from an Omega subtheme in Drupal 7?

How to edit a custom region from an Omega subtheme in Drupal 7

  • 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>

  • Answer:

    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.

tmolhook at Drupal Answers Visit the source

Was this solution helpful to you?

Other answers

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.

hiphip

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.