If you are willing to contribute please send me a mail (johan@pylonweb.dk), and follow the contribution guidelines below. Especially test would be appriciated!
About
Page menus allows you to create and edit several custom menus for your Refinery CMS app.
Requirements
(have not been tested on lower versions but does most likely work on all versions after 2.0.0)
Install
Add this line to your applications Gemfile
gem 'refinerycms-page-menus', '~> 2.0.6'
or for edge version
gem 'refinerycms-page-menus', git: 'git://github.com/pylonweb/refinerycms-page-menus.git'
Next run
bundle install
rails generate refinery:page_menus
rake db:migrate
Now when you start up your Refinery application, go to the pages in your admin interface, and you should see a roll-down menu called "Menus".
Usage
Add to your view
Go to app/views/refinery/pages/_header.html.erb
in your application.
If you don't have this file then Refinery will be using its default. You can override this with
rake refinery:override view=refinery/_header
Then add this code to the header, to generate the custom menu:
<%= render :partial => "/refinery/menu", :locals => {
:roots => refinery_page_menu("custom_menu")
} %>
"custom_menu" must be replaced by the permatitle of your menu.
Rake commands
To show list all your menus and their permatitles run this rake task:
rake refinery:page_menus:menus
You can create a new menu in the rails console, or you can use the following command:
rake refinery:page_menus:create_menu title=some_title
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request