Change Redmine Top-Menu link to an external site
Added by Andreas Gothe about 5 years ago
I'm need to change the 'Help' link in the Top-Menu to 'Documentation' and link to an external site. I would do this with a plugin, first removing the original 'Help' link with this command in the Plugins 'init.rb':
delete_menu_item :top_menu, :help
That worked fine. But when I try to set a new entry with a external link I don't succeed. Something like:
menu :top_menu, :documentation, :caption => 'Documentation', :link_to => 'http://www.example.com/'
Just adds the parameters to a 'localhost' link.
Is there a way to do this inside 'init.rb' or do I need to add a controller/action for this? If this is the case, can someone provide me an example?
I'd be thankful for any help.
Greetings,
Andreas
Replies (2)
RE: Change Redmine Top-Menu link to an external site - Added by Bernhard Rohloff about 5 years ago
I think you swapped the url
argument with caption and you should be fine with just the URL inside.
That's the function prototype of menu in lib/redmine/plugin.rb
.
def menu(menu, item, url, options={})
I think this should work as you expect it.
menu :top_menu, :documentation, 'http://www.example.com/', :caption => 'Documentation'
RE: Change Redmine Top-Menu link to an external site - Added by Andreas Gothe about 5 years ago
Hi Bernhard,
Just gave it a try - and your solution is working great! I was mistaken on the order of arguments here.
Thank you very much!