CustomizingWithLocalDir

From Request Tracker Wiki
Revision as of 15:03, 6 April 2016 by Admin (talk | contribs) (2 revisions imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Under the RT installation tree, there is a directory called 'local'. You can place files under this directory to override most files in the RT installation without touching the original. Also, this allows you to quickly retrace what has been customized when you upgrade RT. This method works for both Mason components which RT puts under share/html/ and Perl library files which RT puts in lib/.

Example

Suppose you don't like default RT header. The Mason component for this is share/html/Elements/Header. To customize it, simply copy it to local/html/Elements/Header and apply your changes to that file. When you restart your web server, your new Header component will be loaded. You must restart your webserver and clear the Mason object cache (or have DevelMode enabled) to for the changes to take effect.

Important thing to know

You must remember that if you put a local/lib/Xxx.pm file under the local directory then RT will never try to load lib/Xxx.pm from the analogous base directory. Files under the local/ directory completely "replace" files from base directories logically.

This can be changed for Mason components. If you want to modify a component, but only use it sometimes and not others, see BypassLocalComponent.

Overriding translation files

Also note that I18N overrides work differently; they go in local/po instead of local/lib/RT/I18N.

Alternatives to the local dir

In many cases you can instead use CustomizingWithCallbacks to customize the web GUI.

For customizing Perl libraries you should also look at CustomizingWithOverlays. Overlays can be put under the local/lib/ tree.

CustomizingWithPatches may be preferred in some cases.

Other ways to customize RT

Customizing