Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Refinery Menus allows you to create and edit several custom menus for your Refinery CMS app. It gives you the ability to add links to any kind of model you want. As default are custom links (fx http://google.com, http://github.com etc.) Refinery Pages and Refinery Resources (files). See the screenshot below for an example.
Add this line to your applications Gemfile
gem 'refinerycms-menus', '2.0.6'
or for edge version
gem 'refinerycms-menus', git: 'git://github.com/pylonweb/refinerycms-menus.git'
Next run
bundle install
rails generate refinery:menus
rake db:migrate
Now when you start up your Refinery application, you should see a new menus tap in the admin interface.
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_menu("custom_menu")
} %>
"custom_menu" must be replaced by the permatitle of your menu.
To show list all your menus and their permatitles run this rake task:
rake refinery:menus:list
You can create a new menu in the rails console, or you can use the following command:
rake refinery:menus:create_menu title=some_title
Refinerycms Menus is very flexible and is very easy to setup your own models, so you can link to them in your menus. To add a new model to Refinerycms Menus, just go to the config file (config/initializers/refinery/menus.rb
) and follow the instructions on how to add your model to the menu_resources
configuration option.
Your model only have to respond to two methods:
url
which must define which path the menu link should link to.Here is a example of how Refinery Pages are added as a custom resource model:
config.menu_resources = refinery_page: {
klass: 'Refinery::Page',
title_attr: 'title',
scope: Proc.new { live.order('lft ASC') }
}
We will very much appreciate all kinds of contributions to refinerycms-menus! Just fork this project, create a new feature branch and open up a pull request. If you don't know how to do this, try to check out RailsCasts episode 300. If you are able, please add tests to your pull requests.
If you have any issues or questions, that you cannot find the answer to here, then please feel free to add an issue on GitHub.
Refinery Menus uses RSpec to test. See the documentation on RSpec GitHub page.
bundle exec refinery:testing:dummy_app
. See the Refinery Testing Guide for more info.bundle exec rake
.FAQs
Unknown package
We found that refinerycms-menus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.