Hi,
This is similar to another issue raised on the D6 version - but I thought I'd make a copy here for the D7 version.
http://drupal.org/node/1025458
The minipanel menu always appears empty, unless on the following page:
admin/structure/menu/manage/main-menu
I presume this is because on the above page the main menu is 'called' and on the others it is not.
For the D6 issue there is now a working patch, but after looking through I couldn't find any way to merge that patch into the D7 version.
Can some kind person give me a clue as to how to solve it?
Many thanks, Joe
Comments
Comment #1
kyen99 commentedI just ran into the same problem. I looked through the code as well and don't see an obvious fix as the issue seems relatively complex. The code comments explain the issue well enough to figure out the problem mainly happens when implementing a menu as a block which led to this simple workaround that may or may not work for you... Implement your menu in your theme's page.tpl.php file using the system main menu (configured in menu settings), rather than as a block. I'm using the Zen theme and it already does this, so could be used as an example.
I hope this helps.
Comment #2
joecanti commentedThanks Kyen99,
Unfortunately it doesn't for now. I'm using Panels Everywhere to build my theme, which means that nothing gets placed into the page.tpl, and it all gets placed onto the page using the Panels GUI.
As a temporary measure I wonder if calling it then hiding it would work - whilst still allowing the block to appear on screen and have the minipanel menu attached.
Do you know what php I would use to call the main menu and applu a CSS class to it?
Many thanks, Joe
Comment #3
Frederic wbase commentedIs there any progress for this problem?
Comment #4
Frederic wbase commentedThis problem can be solved with the theming function to alter the page :-)
grts
fre
Comment #5
FreddieK commentedI created a patch that solved the problem for me. Test if it works for you as well.
// This patch is not working, see #6 and #10 for more info about the problem that I was trying to solve, and how I ended up solving it.
Comment #6
FreddieK commentedDoh! Found what was causing the problem for me. Since we're working with Panels Everywhere one of the theme developer had disabled features[] = main_menu and features[] = secondary_menu in the theme .info file, which caused theme_get_setting('toggle_secondary_menu') to return null, and thus never preparing the menu panes.
Everything works for me now.
Comment #7
b@rries commentedI applied the patch (panelseverywhere-1300076-5.patch), It display the block without the links. please help
Comment #8
joecanti commentedThanks FreddieK,
That sounds like the same problem as me - I'll try that out, but it sounds like it'll work
Cheers, Joe
Comment #9
joecanti commentedHi,
I got an error with the patched verion - not sure if I patched it right though...?
here it is:
Notice: Undefined index: display in menu_minipanels_page_alter() (line 474 of /home/songbeec/public_html/alpha-training/sites/all/modules/menu_minipanels/menu_minipanels.module).
Notice: Trying to get property of non-object in menu_minipanels_page_alter() (line 474 of /home/songbeec/public_html/alpha-training/sites/all/modules/menu_minipanels/menu_minipanels.module).
Warning: Invalid argument supplied for foreach() in menu_minipanels_page_alter() (line 474 of /home/songbeec/public_html/alpha-training/sites/all/modules/menu_minipanels/menu_minipanels.module).
Any chance you could post your patched module file as text file so I can rule out improper patching?
cheers, Joe
Comment #10
FreddieK commentedThe problem (for me) was that the if statements (theme_get_setting('toggle_secondary_menu') etc.) around menu_minipanels_prepare_links(menu_main_menu()) and menu_minipanels_prepare_links(menu_secondary_menu()) returned false since the theme didn't use the primary and secondary menu settings for themes (as they are handled by PE site template).
The patch isn't solving the problem (I realized that it was part of my installation that provided the indexes needed by the patch). I solved the problem for me with updated the theme .info file, as described in #6. Thus, if no new problems arise with Panels Everywhere I probably won't work on this specific issue anymore.
I do think that the dropdowns should be able to be added to any menu, not just primary and secondary, though, and if I find time to fix that (function menu_minipanels_page_alter(&$page) should be able to find all the menus that are used on the current page) I'll probably solve this problem at the same time.
Comment #11
FreddieK commentedArgh, sorry.
Comment #12
joecanti commentedThanks FreddieK!!
Briliant - it works. Just did number 6, then turned it on in my theme settings.
Cheers, Joe
Comment #13
joecanti commented