Add a menu button to the navigation bar

Moderator: crythias

Post Reply
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Add a menu button to the navigation bar

Post by zughafen »

hello,

my goal is to add a button to the standard navigation bar (see attachment)

OTRS 3.0.6

this button would just serve as a link to an external website, in this case to our firm's wiki page.

any thoughts?

thanks and greetings from Germany,
zughafen
You do not have the required permissions to view the files attached to this post.
CSL
Znuny expert
Posts: 159
Joined: 11 Nov 2011, 19:27
Znuny Version: 3.0.11

Re: Add a menu button to the navigation bar

Post by CSL »

I've recently been attempting to do this as well. It's one of those problems that is very, very hard to find information on - I've only managed to dig up these two sources on the web:

http://lists.otrs.org/pipermail/dev/200 ... 02125.html

http://lists.otrs.org/pipermail/otrs/20 ... 20952.html

The problem is that the information in them relates to version 2.x of OTRS. As stated in them, it has to do with adding a new frontend module registration similar to the one for the admin interface:

Code: Select all

$Self->{'Frontend::Module'}->{'Admin'} =  {
  'Description' => 'Admin-Area',
  'Group' => [
    'admin'
  ],
  'Loader' => {
    'CSS' => [
      'Core.Agent.Admin.css'
    ],
    'CSS_IE7' => [
      'Core.Agent.AdminIE7.css'
    ],
    'JavaScript' => [
      'Core.Agent.Admin.SysConfig.js'
    ]
  },
  'NavBar' => [
    {
      'AccessKey' => 'a',
      'Block' => 'ItemArea',
      'Description' => '',
      'Link' => 'Action=Admin',
      'LinkOption' => '',
      'Name' => 'Admin',
      'NavBar' => 'Admin',
      'Prio' => '10000',
      'Type' => 'Menu'
    }
  ],
  'NavBarModule' => {
    'Module' => 'Kernel::Output::HTML::NavBarModuleAdmin'
  },
  'NavBarName' => 'Admin',
  'Title' => ''
};
I haven't managed to get this to work yet. My customized versions just don't show up in the interface. Hopefully someone who has been successful can shed some light on how to go about this in version 3.x.
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

Edit AgentNavigationBar.dtl
Above the </ul> put a link such as
<li><a href="http://url" title="show this on hover">Link Display</a></li>
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

it's not changing anything :-/
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

It's cached, likely. Or you're editing the wrong theme.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

hm, when i do a search in my ftp files for this file i only find one, so i assume it can't be the wrong theme...
now just one more dumb question -> how do i clean the cache? :-/

thanks so much for your help.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

Did you view source/inspect element to see if you might have miscoded the entry?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

yeah, but it doesn't even show up.
is it allowed to be a part of the ARIARoleNavigation?
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

This is how I wrote it... notice at the end:

<li>
<a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
</li>

Code: Select all

<ul id="Navigation" class="ARIARoleNavigation">
<!-- dtl:block:ItemArea -->
    <li id="nav-$QData{"NameForID"}" class="$QData{"CSS"}">
        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Name"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
<!-- dtl:block:ItemAreaSub -->
        <div>
            <div class="ShadowTop"></div>
            <div class="Shadow">
                <ul id="nav-$QData{"NameForID"}-container">
<!-- dtl:block:ItemAreaSubItem -->
                    <li id="nav-$QData{"NameTop"}-$QData{"NameForID"}">
                        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Description"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
                    </li>
<!-- dtl:block:ItemAreaSubItem -->
                </ul>
                <div class="Footer"></div>
            </div>
            <div class="ShadowBottom"></div>
        </div>
<!-- dtl:block:ItemAreaSub -->
    </li>
<!-- dtl:block:ItemArea -->
    <li id="nav-search">
        <a class="Search ARIARoleSearch ARIAHasPopup" id="GlobalSearchNav" href="$Env{"Baselink"}Action=AgentTicketSearch" title="$Text{"Search"}"><span class="SearchIcon">$Text{"Search"}</span></a>
    </li>
    <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
</ul>
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

Yeah, I was just posting that. :) Good job.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

Hm, not too sure what you mean -> it should be a part of ARIARoleNavigation?

According to my code, it is part of that... but still doesn't seem to appear on the front end... :-/
It can't really be that hard, right? What am I missing?

Thanks.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

Ah. it should be before the *last line* </ul> ... :) I thought you caught that already. Sorry.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

sorry, I don't quite follow...

do you mean:

Code: Select all

# --
# AgentNavigationBar.dtl - provides global HTML NavigationBar
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: AgentNavigationBar.dtl,v 1.86 2010/11/08 11:17:56 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<ul id="Navigation" class="ARIARoleNavigation">
<!-- dtl:block:ItemArea -->
    <li id="nav-$QData{"NameForID"}" class="$QData{"CSS"}">
        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Name"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
<!-- dtl:block:ItemAreaSub -->
        <div>
            <div class="ShadowTop"></div>
            <div class="Shadow">
                <ul id="nav-$QData{"NameForID"}-container">
<!-- dtl:block:ItemAreaSubItem -->
                    <li id="nav-$QData{"NameTop"}-$QData{"NameForID"}">
                        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Description"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
                    </li>
<!-- dtl:block:ItemAreaSubItem -->
                </ul>
                <div class="Footer"></div>
            </div>
            <div class="ShadowBottom"></div>
        </div>
<!-- dtl:block:ItemAreaSub -->
    </li>
<!-- dtl:block:ItemArea -->
    <li id="nav-search">
        <a class="Search ARIARoleSearch ARIAHasPopup" id="GlobalSearchNav" href="$Env{"Baselink"}Action=AgentTicketSearch" title="$Text{"Search"}"><span class="SearchIcon">$Text{"Search"}</span></a>
    </li>
    </ul>
    <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
because that doesn't really make sense, right?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

zughafen wrote:

Code: Select all

    </ul>
    <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
No, it doesn't make sense. Put the li before the </ul>

If that doesn't make sense, I explicitly mean the last four lines of the dtl should look like this:

Code: Select all

    
    <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
    </ul>
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

meaning:

Code: Select all

     <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
    </ul>
? but thats how it was already in the post above :D Ohhhh today's just not my day... matches the weather i suppose!
CSL
Znuny expert
Posts: 159
Joined: 11 Nov 2011, 19:27
Znuny Version: 3.0.11

Re: Add a menu button to the navigation bar

Post by CSL »

Crythias' suggestion and your added HTML works fine for me - try running /opt/otrs/bin/otrs.DeleteCache.pl and hitting Ctrl-F5 on your browser to refresh.
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

oh! thanks. I tried that, but I just keep receiving the error, 500 Internal Server Error...
maybe the permissions?

ohhh boy...

thanks for your help so far.
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

or how do you run that... is that for a cronjob?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

zughafen, are you saying you *still* can't get this to work?
Please post your AgentNavigationBar.dtl here. It really isn't difficult.
Take the stock AgentNavigationBar.dtl
immediately before the last line, which is a </ul>,
insert a list item for the menu entry.

That's it. If you get a 500 error, you messed up the dtl.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

crythias wrote:zughafen, are you saying you *still* can't get this to work?
Please post your AgentNavigationBar.dtl here. It really isn't difficult.
Take the stock AgentNavigationBar.dtl
immediately before the last line, which is a </ul>,
insert a list item for the menu entry.

That's it. If you get a 500 error, you messed up the dtl.
this is my AgentNavigationBar.dtl:

Code: Select all

# --
# AgentNavigationBar.dtl - provides global HTML NavigationBar
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: AgentNavigationBar.dtl,v 1.86 2010/11/08 11:17:56 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<ul id="Navigation" class="ARIARoleNavigation">
<!-- dtl:block:ItemArea -->
    <li id="nav-$QData{"NameForID"}" class="$QData{"CSS"}">
        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Name"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
<!-- dtl:block:ItemAreaSub -->
        <div>
            <div class="ShadowTop"></div>
            <div class="Shadow">
                <ul id="nav-$QData{"NameForID"}-container">
<!-- dtl:block:ItemAreaSubItem -->
                    <li id="nav-$QData{"NameTop"}-$QData{"NameForID"}">
                        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Description"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
                    </li>
<!-- dtl:block:ItemAreaSubItem -->
                </ul>
                <div class="Footer"></div>
            </div>
            <div class="ShadowBottom"></div>
        </div>
<!-- dtl:block:ItemAreaSub -->
    </li>
<!-- dtl:block:ItemArea -->
    <li id="nav-search">
        <a class="Search ARIARoleSearch ARIAHasPopup" id="GlobalSearchNav" href="$Env{"Baselink"}Action=AgentTicketSearch" title="$Text{"Search"}"><span class="SearchIcon">$Text{"Search"}</span></a>
    </li>
     <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
    </ul>
   
   

...just as we discussed.
the 500 error comes only when i try the otrs.DeleteCache.pl, i am not even sure how to run this.

what the heck am i missing? im not familiar with this kind of coding, that's why I sought this forum ;-)
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

You didn't mention whether your link worked or not. If it does, don't worry about deleteCache. If it does not, is it because you wanted this in Customer instead of Agent?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

Code: Select all

# --
# AgentNavigationBar.dtl - provides global HTML NavigationBar
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: AgentNavigationBar.dtl,v 1.86 2010/11/08 11:17:56 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<ul id="Navigation" class="ARIARoleNavigation">
<!-- dtl:block:ItemArea -->
    <li id="nav-$QData{"NameForID"}" class="$QData{"CSS"}">
        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Name"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
<!-- dtl:block:ItemAreaSub -->
        <div>
            <div class="ShadowTop"></div>
            <div class="Shadow">
                <ul id="nav-$QData{"NameForID"}-container">
<!-- dtl:block:ItemAreaSubItem -->
                    <li id="nav-$QData{"NameTop"}-$QData{"NameForID"}">
                        <a href="$Env{"Baselink"}$Data{"Link"}" title="$Text{"$Data{"Description"}"}$QData{"AccessKeyReference"}" accesskey="$QData{"AccessKey"}" $Data{"LinkOption"}>$Text{"$Data{"Name"}"}</a>
                    </li>
<!-- dtl:block:ItemAreaSubItem -->
                </ul>
                <div class="Footer"></div>
            </div>
            <div class="ShadowBottom"></div>
        </div>
<!-- dtl:block:ItemAreaSub -->
    </li>
<!-- dtl:block:ItemArea -->
    <li id="nav-search">
        <a class="Search ARIARoleSearch ARIAHasPopup" id="GlobalSearchNav" href="$Env{"Baselink"}Action=AgentTicketSearch" title="$Text{"Search"}"><span class="SearchIcon">$Text{"Search"}</span></a>
    </li>
     <li>
    <a href="http://wiki.zughafen.de" title="Zughafen Wiki">WIKI</a>
    </li>
</ul>
This should work as is.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

crythias wrote:You didn't mention whether your link worked or not. If it does, don't worry about deleteCache. If it does not, is it because you wanted this in Customer instead of Agent?
no, that's the problem. no link appears, there is no link. and I couldn't get deleteCache to work anyway.
Nope, I need this on the agent site.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

I used your code exactly as you posted.
I moved my Kernel/Output/HTML/Standard/AgentNavigationBar.dtl to the side and created a new one as a copy paste from what you presented.
I logged in to my test server and got this:
Dashboard - OTRS.png
That's *all* I did. No cache, no refresh, no nothing extra.
First thing to do for your test is to rename the AgentNavigationBar.dtl and see if it breaks anything. If it does, you know you're editing the proper file.
You do not have the required permissions to view the files attached to this post.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zughafen
Znuny newbie
Posts: 13
Joined: 05 Jul 2012, 12:24
Znuny Version: OTRS 3.0.6
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Post by zughafen »

well, at least i'm happy that it works for you ;-)

well, stupidly i never thought of that before -> i took your advice and renamed the file, and it didn't break anything. so, that would mean I'm editing the wrong file. voila! now i have to find out where the correct file is, because when i do a search for that file, i only find one on the entire server...

but i did notice that our server is set up like this:

otrs-3.0.6
otrs -> otrs-3.0.6
otrs-web -> otrs/var/httpd/htdocs


i guess i'll have to do some investigating to find out where my proper files are. or is there an easier way via "inspect element"...

thanks again,
and greetings from Germany.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add a menu button to the navigation bar

Post by crythias »

zughafen wrote:i only find one on the entire server
I don't know... could it be possible you're on a dev/test server and not production?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply