Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Menu Issues


Reply


3 Posts   2006 Views

Avatar
Colt

Community Member, 3 Posts

6 April 2008 at 3:58pm

Hi all,

I'm new to SS, I have just installed it and am having a few issues with the menus. Any help would be greatly appreciated.

Firstly, I would like to create a third menu. I have a basic site setup..about, services, products, contact etc.. For example; in the sidebar on the homepage I have a menu of products: (I would like this menu to be displayed on each of the main pages stated above)

- product 1
- product 2
- product 3
- product 4

When a product is clicked I would like a new menu displayed in the sidebar that replaces the one above, so a product specific menu.

Another issue I am having is adding a dropdown menu to a level 1 menu item, is there an easy way to do this?

Thanks

Avatar
hitautodestruct

Community Member, 19 Posts

6 April 2008 at 7:55pm

Edited: 06/04/2008 7:56pm

So what you basically need is one main menu template. You need to include this menu in every one of the templates that hold the pages you want to have the menu in.

To do this you must create a new code snippet containing your menu.
This should be just the code for the menu no <html></html> surrounding.
Save that code snippet as yourMenu.ss in the folder /yourSiteDir/templates/include/
Now to include your code snippet in any one of your templates use this code:

<% include yourMenu %>

Hope this answers your question.

As for your second question you should have a look at the [url=http://doc.silverstripe.com/doku.php?id=tutorial:1-building-a-basic-site#making_a_navigation_system]Making a naviation system[/url] tutorial.
Try to write some static code for a drop down menu and then tweak it for use with the "control" method.

Cheers

Avatar
Colt

Community Member, 3 Posts

9 April 2008 at 10:23am

Thanks for your help Hitautodistruct - all sorted. Cheers.