Project

General

Profile

Adding Multiple Menu Items to Top Menu

Added by marco deluca almost 13 years ago

Hi there,

I've successfully installed redmine 1.2.1 on a VPS host but I need a hand creating a 2nd, 3rd, 4th custom menu item. This was my first installation of any rails app, and I'm not really that good with any of this technical stuff:) Once I got the right versions of all the required gems, things went fairly smoothly until I tried to create multiple menu items.

I was able to run script/generate redmine_plugin add_link and followed the steps on this forum post: [[http://www.redmine.org/boards/2/topics/12275?r=12762]] so I ended up with an init.rb file that had this in it:

menu :top_menu, :my_link, {:controller => 'activity', :action => ''},
13        :caption => "Activity" 

Basically created a link to the activity list. Trying to do the same thing for issues, etc. How would I create multiple menu links? I tried adding stuff to that init.rb, or creating a different plugin like add_link2, but everything I did broke redmine.

Suggestions?


Replies (3)

RE: Adding Multiple Menu Items to Top Menu - Added by Egidijus Zideckas over 12 years ago

Same happened to me...
Have a look at plugin http://www.redmine.org/plugins/redmine_time_tracker
They embedded html menu for that.

RE: Adding Multiple Menu Items to Top Menu - Added by Mischa The Evil over 12 years ago

marco deluca wrote:

[...]

How would I create multiple menu links? I tried adding stuff to that init.rb, or creating a different plugin like add_link2, but everything I did broke redmine.

Suggestions?

You can easily add multiple links to the top_menu using the plugin you've already created. Just modify the init.rb file (based on the quoted content by Holger Just) to include a second (third etc.) line like:

require 'redmine'

Redmine::Plugin.register :redmine_rt_link do
  name 'Redmine Add Link'
  author 'Holger Just'
  url 'http://dev.holgerjust.de/projects/redmine-misc'
  author_url 'http://meine-er.de'
  version '0.1.0'
  requires_redmine :version_or_higher => '0.8.0'

  # caption can also be a i18n symbol or a proc
  menu :top_menu, :global_activity, {:controller => 'activity', :action => ''},
       :caption => "Global activity" 
  menu :top_menu, :global_issues, {:controller => 'issues', :action => ''},
       :caption => "Global issues" 
end

Hope this will help you out...

RE: Adding Multiple Menu Items to Top Menu - Added by Mischa The Evil over 12 years ago

Egidijus Zideckas wrote:

Same happened to me...
Have a look at plugin http://www.redmine.org/plugins/redmine_time_tracker
They embedded html menu for that.

Embedding a html menu for such purposes as described by Marco isn't specifically required. It can be done using a code-snippet like the one I've posted above...

    (1-3/3)