Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Menu Issues

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

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

Page: 1
Go to End
Author Topic: 1983 Views
  • Colt
    Community Member
    3 Posts

    Menu Issues Link to this post

    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?


  • hitautodestruct
    Community Member
    19 Posts

    Re: Menu Issues Link to this post

    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 Making a naviation system tutorial.
    Try to write some static code for a drop down menu and then tweak it for use with the "control" method.


  • Colt
    Community Member
    3 Posts

    Re: Menu Issues Link to this post

    Thanks for your help Hitautodistruct - all sorted. Cheers.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.