Skip to content

Menu Helper sp_list_menu

davydotcom edited this page Jun 15, 2012 · 1 revision

The menu helper is capable of generating a

    block of the menu trees created in the administrative panel. Example Syntax: <%=sp_list_menu({:id => "navigation",:name => "Main"})%>

    Might output

    Options

:class => nil
:max_depth => 0
:menu_id => nil
:name => nil
:start_menu_item_id => nil

:class

This value will optionally set the class name of the ul block that is generated

:max_depth

This value will determine how deep the nested submenus will render. If you have a theme that is only designed to go 1 level deep you can set the :max_depth => 2. By default :max_depth=>0 means that the depth condition is ignored.

:menu_id

If you know the id number of the menu you would like to render, you can specify it via this option. (It is recommended to specify the menu to render by name as that is more informative to the user)

:name

This allows you to specify which menu to render by name

:start_menu_item_id

Sometimes it becomes necessary to render a small subset of a menu rather than an entire menu. This can be done by specifying the menu_item_id.

Clone this wiki locally