Project

General

Profile

How to open the link in a new windows.

Added by Jacky Ho over 7 years ago

Hi All,
I'm adding more a account_menu by using plugin, here is my init.rb:

Redmine::Plugin.register :redmine_static_link do
  name 'Redmine link'
  author 'Jacky Ho'
  description 'Shows a link on the account menu'

  version '0.1.0'

  menu :account_menu, :ChangePwd, "http://example.com", :caption => 'Change Password', :after => :my_account
end

The plugin work perfectly, the button showed next to My Account.
The question is "How to open the link in new windows?"

Anyone can help?

Thanks


Replies (3)

RE: How to open the link in a new windows. - Added by Jacky Ho over 7 years ago

I've found problem for myself:

menu :account_menu, :ChangePwd, "http://example.com", :caption => 'Change password', :after => :my_account, :html => {:target => '_blank'}

RE: How to open the link in a new windows. - Added by Jacky Ho over 7 years ago

By the way, How to hide this button link when user not logged in?
Please the picture as attached.

RE: How to open the link in a new windows. - Added by Jacky Ho over 7 years ago

Jacky Ho wrote:

By the way, How to hide this button link when user not logged in?
Please the picture as attached.

For those concerning

by adding:

:if => Proc.new { User.current.logged? }
    (1-3/3)