let's say I want to have a second menu bar in the default mobile template (the main menu bar can hold only a few items due to screen size).
This is what I tried so far:
1) Create a new Menu (Admin -> Menu -> Add Menu...) I give it the name "mobile_sub" and title "mobile_sub"
2) Create a new Link (Admin -> Menu -> Add Menu Link). I select "mobile_sub" from the drop down and add the link info.
First thing I noticed is, when I tried to give the new Menu a name like "Mobile Sub" I get an error message:
"Menu name can contain only alphanumeric characters and underscores!"
This is a bit odd since the other existing modules DO have names with spaces and capital letters, so I just called it "mobile_sub" for name AND title
So far I have created a new Menu and one Link in this new Menu.
Then I go into FTP and open: /mobile/templates/default/header.tpl.php
In line 41 I find this:
<div data-role="navbar"><ul><?php echo p('menu_main', $this->menu); ?></ul></div>
I assume this is calls the main mobile menu. I also found a corresponding file /mobile/templates/default/extend/plugins/menu_main.plugin.php
What would I need to do to display the newly created mobile sub menu? Would I have to duplicate the menu_main.plugin.php file first?
I'm kind of lost here as I don't really see why I can add menus in admin panel but I can't really display them?
Any help is greatly appreciated!!
You can try add more items to your main menu and see if they will appear one below another? I remember this works with jquery mobile. Add like 10 items to the main menu and try.
I tried that but it just keeps shrinking the items to a point where you can't tell them apart anymore. So on a regular portrait phone screen you can fit 4-5 items with short text, anything above just doesn't work. That's why I tried to create a second line mobile menu...
Oki. Add in admin a new menu, call in mobile_second and then copy /mobile/templates/default/extend/plugins/menu_main.plugin.php to /mobile/templates/default/extend/plugins/menu_second.plugin.php (also change the function name and also change WHERE m.name = 'mobile_main' to WHERE m.name = 'mobile_second'). Then in mobile/templates/default/header.tpl.php add:
<div data-role="navbar"><ul><?php echo p('menu_second', $this->menu); ?></ul></div>