How to create a submenu in admin?

268 views
Skip to first unread message

Máté Kaszás

unread,
Nov 9, 2013, 7:11:38 AM11/9/13
to spree...@googlegroups.com
Hi Guys!
Currently building a CMS extension for Spree. I successfully added "CMS" into the admin menu but not sure how to create a sub-menu for it (Pages/Blog/Categories etc.). I saw that there is a submenu partial in the views/spree/admin/shared directory, but based on the tabs partial I am not sure how to add the submenu items with the urls i created for them in the extension…
Any suggestions?

Best Wishes,
Matt

Alberto Vena

unread,
Nov 9, 2013, 4:03:32 PM11/9/13
to spree...@googlegroups.com
Hi Matt,

you can take a look at the other resources which use that submenu, for example at products.

Basically you have to add a shared partial in each views you want the menu to be displayed.

For example, into admin products edit (https://github.com/spree/spree/blob/master/backend/app/views/spree/admin/products/edit.html.erb#L10) Spree adds the partial

<%= render :partial => 'spree/admin/shared/product_sub_menu' %>

Here it is the partial content: https://github.com/spree/spree/blob/master/backend/app/views/spree/admin/shared/_product_sub_menu.html.erb .

You can use a similar structure for your extensions needs.

Hope to be helpful.

Alberto Vena

--

http://nebulab.it/

Alexis Rabago

unread,
Feb 24, 2014, 4:01:28 PM2/24/14
to spree...@googlegroups.com
Amazing thnx a lot



Reply all
Reply to author
Forward
0 new messages