Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2014-02-06 14:51:50

fitboy
Member
Registered: 2013-01-14
Posts: 123

Second Menu bar in Mobile Template - how???

Hi,

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

Mike

Offline

#2 2014-02-06 17:44:55

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Second Menu bar in Mobile Template - how???

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.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2014-02-06 18:21:30

fitboy
Member
Registered: 2013-01-14
Posts: 123

Re: Second Menu bar in Mobile Template - how???

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

Offline

#4 2014-02-07 07:41:22

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: Second Menu bar in Mobile Template - how???

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>

Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2014-02-10 13:17:21

fitboy
Member
Registered: 2013-01-14
Posts: 123

Re: Second Menu bar in Mobile Template - how???

awesome! thanks, that worked well :-D

Offline

Board footer

Powered by FluxBB