Add target attribute to Logo
Hello everyone, I am new to Request Tracker but I was asked if it was possible to add an attribute the the logo so that when clicked it would target to a new tab instead of the default self. This is possible but you will have to edit RT's code to add it in.
These instructions are for 4.0.5 or later and I am on Ubuntu 12.04. Anything earlier my not have the same paths.
Step 1
First open Terminal...
Depending on where you installed RT this path may be different. NOTE: RT default installs to opt/rt.
cd /var/www/share/html/Elements gedit Logo
Once Logo is open you need to find the bit of code that says:
<a href="<%ARGS{'LogoLinkURL'}||RT->Config->Get('LogoLinkURL')%>">
right after you see the "href='code'" and before the ">" you need to enter this bit of code: NOTE: The name LogoTarget can be changed to somethign else just make sure that you change it everywhere. I just used it because it made the most since to me
target="<%ARGS{'LogoTarget'}||RT->Config->Get('LogoTarget')%>
Save and close Logo.
Step 2
Now you will need to gedit RT_Config.pm(WARNING:Changing RT_Config.pm can make RT crash all together and ruin your install of RT. Make sure you make a copy of RT before you make any changes and do not change anything but what this guide has stated.)
cd /var/www/etc gedit RT_Config.pm
For ease do a (Ctrl+f) and type in logo and hit next once. You should be on:
=item C<$LogoURL> C<$LogoURL> points to the URL of the RT logo displayed in the web UI. This can also be configured via the web UI. =cut Set($LogoURL, RT->Config->Get('WebImagesURL') . "bpslogo.png");
You will need to add this bit of code right after:
=item C<$LogoTarget> C<$LogoTarget> tells the logo URL where to go when clicked. =cut Set($LogoTarget, "_self");
Save and close RT_Config.pm
Step 3
Stay where you are but open RT_SiteConfig.pm:
gedit RT_SiteConfig.pm and under:
Set($rtname, 'example.com'); #I would change this to the URL of your website, btw.
Add on the next line:
Set($LogoTarget, '_blank');
Save and close RT_SiteConfig.pm
Finally
Now for these changes to take effect you will need to reset you cached data by:
cd /var/www/var/mason_data rm -r "the folder that contains the data"("" are not needed)
For example, my folder was called 3583955927.
I would also restart your apache just to be safe with:
service apache restart
and restart your instance of RT.
Your logo should now be sending you to a new tab.