Spree Navigator

View the Project on GitHub dfreerksen/spree_navigator

Spree Navigator

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.

Usage

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.

Default Menu

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.

Menu Item Listing

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.

Menu Item Management

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.

Add

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.

Rename

Renaming a menu item will not redirect to the edit page. Renaming a menu item is does inline.

Remove

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.

Edit

Clicking on Edit will redirect to the edit page for that item.

Installation

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

Testing

Generate a dummy application

bundle exec rake test_app

Running tests

bundle exec rake spec

Contributing

  1. Fork it ( https://github.com/dfreerksen/spree_navigator/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Authors and Contributors

Created and maintained by:

Contributors include:

Support

Having trouble? Check out the wiki or view current issues.