Spree Navigator (spree_navigator) is a customizable navigation menu for Spree. Sure you can overwrite the view file in your application to add your own menu items. But what fun would that be?
Works well with multi-tenant sites or applications where overwriting the views/spree/shared/_main_nav_bar.html.erb
file is not an option.
Spree Navigator assumes views/spree/shared/_main_nav_bar.html.erb
has not been modified in anyway. This gem will use the existing views/spree/shared/_main_nav_bar.html.erb
as it comes from Spree. By modifying this file, there is a chance the menu will not display.
The default menu is the Home
link. Of no menu items are specified, the menu defaults to the Home
link; The same that is available in Spree by default.
After creating one more more menu items, they will immediatly start showing up on the frontend. You can organize menu items by dragging them around. You can even nest items inside other menu items.
Each menu item can have a custom HTML id applied to it. If one is not specified, it will default to menu_item_123
where 123
is the primary key from the database.
Each menu item can have custom HTML classes applied to it. All menu items already apply a class of menu-item
to the li
. If a custom classes is not specified, it will default to menu-item-123
where 123
is the primary key from the database.
At any time, you can right click on a menu item to open the management menu for that item. This menu allows you to quickly access the main management features fpr each menu item.
Adding a menu item will add the new menu item as a child of the menu item that was selected. If the new meni item needs to be a top level menu item, you can either click New Menu Item
in the top right corner or drag the new item to the correct position after it has been created.
Renaming a menu item will not redirect to the edit page. Renaming a menu item is does inline.
Since this is a destructive action, selecting Remove
will prompt you to confirm you intension to remove that menu item. Removing a menu item will also remove all child and nested child items as well.
Clicking on Edit
will redirect to the edit page for that item.
Add this line to your Spree application's Gemfile:
gem 'spree_navigator', github: 'dfreerksen/spree_navigator'
Run the bundle command to install it:
bundle install
After installing, run the generator:
bundle exec rails g spree_navigator:install
Generate a dummy application
bundle exec rake test_app
Running tests
bundle exec rake spec
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Created and maintained by:
Contributors include: