After installing the 6/10 dev version of 7.x I tried to define items in the structure/menus/'secondary menu' page and added code to display it on the web site. But instead of the menu items I defines it displays the items defined under the user menu. Display code is:

if ($secondary_menu && !$in_overlay):

endif;

When I changed the code to select the 'user menu' it gave an undefined index error on 'user menu'

If I need to enable the 'user menu' how do I do it? Even so, why is a request fro secondary menu data returning items stored under user menu?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcrocks’s picture

Further information. I had positioned the secondary menu outside the block system so I could style it separately and lay it out independent of the block default region definitions. When I added a secondary menu through the structure/blocks page it picked up the correct elements.

I also created a 'main' menu the same way. The results: if a menu is created outside the block system and it is a 'main' menu it picks up the correct items. If it is a 'secondary' menu, it picks up the items defined for the user menu. If it is a 'user' menu it generates error messages. I didn't try the other menu types.

The image shows what I'm trying to do. The 'secondary' menu is on top and the 'main' menu is the bottom one. You can see the standard user menu items displayed by selecting 'secondary' links as in the code above.

dcrocks’s picture

ps. I am using the 'corolla' theme as a base and it shows the same results when creating menus outside the block system.

dcrocks’s picture

Title: Secondary menu selecting user menu items » Secondary menu inside block vs secondary menu outside block

Apparently content type = 'menus' can only be used inside blocks. There are 2 special menus "main"(=main menu) and secondary(=user menu) that can be used in any region and outside blocks. Use of any other menu outside a block results in 'unknown variable' errors. Why is this? If I want to create a menu for my theme that is displayed outside a block I have to hard code it. Doesn't seem reasonable or friendly. There may be non-core modules out there that solve this but at this stage of 7.X most are still under development. Is this restriction on content type 'menus' documented anywhere(and a reason given)?

JohnAlbin’s picture

Um… you are inside the contributed module "menu_block"'s issue queue. It is designed to allow you to create configurable blocks of menu trees. And its D7 release is being used on production servers as we speak. Maybe its the module you are seeking in comment #4?

Also, I think you posted in the wrong queue, however, I can answer your question…

The $secondary_menu and $main_menu variables are only valid inside page.tpl and contain the links specified in the admin config form at admin/structure/menu/settings. By default the main menu variable takes its links from the "main menu" and the secondary menu variable takes it links from the "user menu", I believe.

dcrocks’s picture

What is the difference between 7.x-2.x and 7.x-3.x?

JohnAlbin’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev

Use the 7.x-2.0-beta2 release.

dcrocks’s picture

Component: User interface » Code

I got it, I just need to figure it out, but it looks like what I want. The inconsistent use of secondary menu is confusing, Too bad they couldn't have just used 'user menu' so that the name matched the purpose. Or names distinct from those in structure/menus.

Sorry about picking the wrong issue. I'd like to change it if I could. I guess it should be 'menu system'. I don't think I will be the last person confused by this.

dcrocks’s picture

Status: Active » Closed (fixed)

I've found enough info to cope, but I think there will be others asking questions about this.