Loading...
 
Skip to main content

Themes


Dynamic Menuing

Hello all,

I'm trying to come up with a menu bar across the top with sub menus. So I've replaced the Tiki-Top_Bar.tpl with a row of links that is like this:

Image
Copy to clipboard
Link1 Link2 Link3 MoreStuff


When they click Link1, I want a submenu to appear below it

Image
Copy to clipboard
Link1 Link2 Link3 Morestuff Sublink1-1 Sublink1-2 Sublink1-3 Sublink1-4


And a different list for Link2. It seems like I should be able to have Link1 have an option in the URL that turns on the particular submenu, but I'm not yet versed enough to know the best way to do this.

Any suggestions?

Thanks,
-JEEP

Hmm... did I ask this in the wrong forum?

Anyway, I just need to know how to pass variables back and forth through the templates based on what is clicked. I'll keep investigating, but a pointer might save me a little time.

Thanks,
-JEEP


Tiki has a ready-made solution for you: phplayers menu. (See one in use at my family website, which runs on Tiki 1.9.0: cunningham-lee.comQuestion).

First of all, turn on the phplayers menu feature on the Admin/Features page.

Then make a new menu on the Admin/Menus page. Your "links" should be given the type "section" and your "sublinks" should be give the type "option". Each link has a number. These numbers don't have to be sequential, but items are displayed in numerical order; I suggest skipping five or whatever numbers in between each menu item for possible future use. Then you won't have to renumber old items.

Each item should have the wiki section indicated (see the default Tiki menu for examples: things like "feature_blogs," and you can specify a permission and a group if you want to limit the item's visibility. Your admin links, for example, can have the "Admin" group set, so normal users will get the menu without these links.

When the menu is done and saved, get its number. Now you have to edit the tiki-top_bar.tpl file. Add the line
Copy to clipboard
{phplayers id=n type=horiz}

with n being the id number of your new menu.

The style details of the menu are determined by each theme's CSS file.

Good luck and post again if you have any questions.

-- Gary