1

Hey can you guys please help me out iv tried researching and asking other but unfortunately have screwed it up many times and cant seem to get an answer out of anyone. Can someone please help me understand how to create a new region? I have mega-menu atm but when it was created in the files it went driectly under the menu bar which is not desirable... all im trying to do is put the mega-menu "menu" over the default one so it looks nice and professional anyone that can help me out, thanks.

0

It depends a bit on your theme but for bartik here is answer:

In theme info file add this:

regions[my_custom_region] = My Custom Region

Then copy page.tpl.php from the base theme, or else from modules/system directory into your theme's folder. Open it up, and look for the bit where it prints out the main menu. It will be something like this:

<?php if ($main_menu || $secondary_menu): ?> 
      <div id="navigation"><div class="section"> 
        <?php print theme('links__system_main_menu', array('links' => $main_menu, 
'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 
'clearfix')), 'heading' => t('Main menu'))); ?> 
        <?php print theme('links__system_secondary_menu', array('links' => 
$secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => 
array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?> 
      </div></div> <!-- /.section, /#navigation --> 
<?php endif; ?>

Remove this bit, then add this in its place:

<?php print render($page['my_custom_region']); ?> 

Now clear your cache and place your block inside it.

Rename the my_custom_region to whatever you like, but make sure it is same in info file and page.tpl file.

If you don't want to replace the main menu then you can just paste the new code underneath the main menu, and in the menu settings UI select no main menu to hide it.

| improve this answer | |

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.