Project

General

Profile

Tabs Plugin for Wiki-Links: how to set the status tab to the correspondending Tab entry

Added by Michael Pfannkuchen almost 13 years ago

Hallo there,

I'm just developing an simple plugin to enhance the project tab with some links to Wiki pages. This works fine with one exception: after loading the Wiki Subpage, the "active" status is always set to the default "Wiki" tab entry instead of the clicked menu tab entry. (see red arrow in the image below)

My current code from http://www.project-roadmap.com/project-portal/projects/proro-download/wiki/Events is as follows:

require 'redmine'

Redmine::Plugin.register :redmine_project_menu_change do
  name 'Redmine Project Menu Change plugin'
  author 'Deka Merone'
  description 'This is a plugin for Redmine to customize the projects menu'
  version '0.0.1'
  url 'http://www.project-roadmap.com/project-portal/'
  author_url 'http://www.dekamerone.de'

#menu :project_menu, :projectmenuchanges, { :controller => 'wiki', :action => 'show', :project_id => 'proro-download' }, :caption => 'Einstiegsseite'
menu :project_menu, :projectmenuchanges, { :controller => 'wiki', :action => 'show' }, :caption => 'Einstiegsseite', :before => :overview, :param => :project_id
menu :project_menu, :projectmenuchanges2, { :controller => 'wiki', :action => 'show', :id => 'Movies' }, :caption => 'Movies', :before => :overview, :param => :project_id
menu :project_menu, :projectmenuchanges3, { :controller => 'wiki', :action => 'show', :id => 'Image_Galleries' }, :caption => 'Image Galleries', :before => :overview, :param => :project_id
menu :project_menu, :projectmenuchanges4, { :controller => 'wiki', :action => 'show', :id => 'Link_List_+_Literature' }, :caption => 'Link List + Literature', :before => :overview, :param => :project_id
menu :project_menu, :projectmenuchanges5, { :controller => 'wiki', :action => 'show', :id => 'Events' }, :caption => 'Events', :before => :overview, :param => :project_id
menu :project_menu, :projectmenuchanges6, { :controller => 'wiki', :action => 'show', :id => 'Our_Team' }, :caption => 'Our Team', :before => :overview, :param => :project_id

end 

Any ideas how to set the "active tab status" here?

Thx for all and Happy projects : Michael


Replies (2)

Linking Within a Wiki Page via the Tabs Plugin - Added by Ben Collins over 12 years ago

I want directly Link to anchor on a Wiki Page via the Redmine Project Menu Change plugin.

Here is my current code:

menu :project_menu, :projectmenuchanges, { :controller => 'wiki', :action => 'show', :id => 'WikiPage#AnchorOnWikiPage' }, :caption => 'AnchorOnWikiPage', :after => :overview, :param => :project_id

The result is
hxxp://localhost/redmine/projects/Project123/wiki/WikiPage%23AnchorOnWikiPage and i promted to write a new wiki page, but i want
hxxp://localhost/redmine/projects/Project123/wiki/WikiPage#AnchorOnWikiPage, so that the Wiki Page opens and the the right text paragraph is displayed.

How can i achieving this? How can i prevent the URL encoding from # to %23 ? I would be thankful for any help.

ps I am running Redmine 1.2.1 on Windows 7 64 bit apache 2.2.19 / mongrel 1.1.5

RE: Tabs Plugin for Wiki-Links: how to set the status tab to the correspondending Tab entry - Added by Gaston Falco over 11 years ago

Hi Michael.

I edit my redmine.rb and add:

menu.push :test_page, { :controller => 'wiki', :action => 'show', :id => 'Testpage' }, :param => :project_id,
:if => Proc.new { |p| p.wiki && !p.wiki.new_record? }

But I cant see how to make the Testpage keep selected.

How can you solve it?

Thanks!

    (1-2/2)