Project

General

Profile

How to change Top Menu?

Added by Richard Körber over 14 years ago

Hi!

I want to change the top menu. Right of the "Help" link, I would like to add a new link. It should link to a page of a project's wiki. It's always the same page of the same project, so a static link would already do. I even don't need right management, as the link should be visible even to anonymous visitors.

How can I do that?

Thanks in advance!


Replies (2)

RE: How to change Top Menu? - Added by Eric Guirbal over 14 years ago

Hi,

Have a look at:
  • this tutorial. It explains how to extend the menus.
  • the wiki extensions plugin. It can add project menu tabs that links to wiki page. It should be straightforward to adapt it to your need.

Regards.

RE: How to change Top Menu? - Added by Richard Körber over 14 years ago

Thank you, Eric!

I was hoping for an easier approach, but this is already fine for me.

I have now created a new project called "site", with a wiki that contains a page called "contact". In the plugin's init.rb I have added this line:

menu :top_menu, "Contact", { :controller => 'wiki', :action => 'site', :id => 'contact' }, :before => :help

Now I see a top menu "Contact" that always links to the contact page of that project's wiki. This is fine so far.

What I need now is localisation. For a German visitor, I want the menu called "Kontakt", and it shall link to a wiki page called "kontakt". For non-German visitors, "Contact" and a link to "contact" shall appear instead.

I'm not a Ruby programmer... How can I evaluate the browser's language and use the menu's :if option properly?

    (1-2/2)