Add a menu button to the navigation bar

Moderator: crythias

Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 12:49

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.
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby CSL » 05 Jul 2012, 13:28

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
CSL
OTRS wizard
 
Posts: 158
Joined: 11 Nov 2011, 19:27

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 14:38

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 15:00

it's not changing anything :-/
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 15:13

It's cached, likely. Or you're editing the wrong theme.
OTRS 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 15:21

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.
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 15:29

Did you view source/inspect element to see if you might have miscoded the entry?
OTRS 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 15:46

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

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 15:53

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>
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 15:57

Yeah, I was just posting that. :) Good job.
OTRS 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 16:02

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.
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 16:13

Ah. it should be before the *last line* </ul> ... :) I thought you caught that already. Sorry.
OTRS 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 16:21

sorry, I don't quite follow...

do you mean:

Code: Select all
# --
# AgentNavigationBar.dtl - provides global HTML NavigationBar
# Copyright (C) 2001-2010 OTRS AG, 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?
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 05 Jul 2012, 16:24

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 05 Jul 2012, 16:28

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!
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby CSL » 05 Jul 2012, 18:32

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
CSL
OTRS wizard
 
Posts: 158
Joined: 11 Nov 2011, 19:27

Re: Add a menu button to the navigation bar

Postby zughafen » 06 Jul 2012, 01:08

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
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby zughafen » 06 Jul 2012, 12:53

or how do you run that... is that for a cronjob?
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 06 Jul 2012, 15:05

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 06 Jul 2012, 15:48

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 OTRS AG, 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 ;-)
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 06 Jul 2012, 15:59

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby crythias » 06 Jul 2012, 16:01

Code: Select all
# --
# AgentNavigationBar.dtl - provides global HTML NavigationBar
# Copyright (C) 2001-2010 OTRS AG, 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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 06 Jul 2012, 16:04

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.
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 06 Jul 2012, 16:33

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA

Re: Add a menu button to the navigation bar

Postby zughafen » 06 Jul 2012, 21:28

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.
zughafen
OTRS newbie
 
Posts: 13
Joined: 05 Jul 2012, 12:24
Location: Thüringen, Germany

Re: Add a menu button to the navigation bar

Postby crythias » 06 Jul 2012, 22:00

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 3.3.x (private/testing) and 3.0 (public) on Linux with MySQL database. Also on github.
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
User avatar
crythias
Moderator
 
Posts: 7272
Joined: 04 May 2010, 18:38
Location: SouthWest Florida, USA


Return to Help

Who is online

Users browsing this forum: andik, mathiask and 2 guests