Change Redmine Top-Menu link to an external site

Added by Andreas Gothe 24 days 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 23 days 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 23 days 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!

(1-2/2)