I had a question emailed to me about Redmine and I thought it would make a useful blog post:
If I wanted to add a link example.com to the top menu how would I do that?
I’ve seen this asked several times and most responses are to modify Redmine’s source. While this will work, it will make Redmine upgrades harder. The best solution is to create a small Redmine plugin and drop it into the vendor/plugins
directory. Only one Ruby file is needed, plus any language translations.
1 2 3 4 5 6 7 8 9 10 |
# init.rb Redmine::Plugin.register :redmine_static_link do name 'Redmine link' author 'Eric Davis of Little Stream Software' description 'Shows a link on the top menu' version '0.1.0' menu :top_menu, :example_link, "http://www.example.com" end |
You can see that all the init.rb
does is to register a new plugin and add a :top_menu
link to http://www.example.com. Once Redmine is reloaded, you should see the link on the top menu.
I’ve uploaded the full plugin, along with English language translations. Go ahead and download it and change the link url to what you need.
If you have any other Redmine or Redmine plugin questions that you would like me to write about, please ask them on my User Voice.
Eric
Still works with Redmine 2.0. Thanks!