AddCustomStyleSheet

From Request Tracker Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Using a Callback to Add a StyleSheet (Chuck Boeheim, Gary Oberbrunner)

As of 3.8.2 at least, you can add things to main.css by putting them in

/opt/rt3/local/html/Callbacks/ANYTHING/NoAuth/css/web2/main.css/End

and anything you put there will get stuffed into main-squished.css.

Here's the older text that was on this page, for reference:

=

There isn't currently a place provided to load an additional stylesheet in the header processing, but there is a general Header callback.

Putting the following file in /opt/rt3/local/html/Callbacks/SLAC/Elements/Header/Head

%# SLAC Addition to load another stylesheet on request.
<%args>
$Stylesheet => undef
</%args>
<!-- Local header included -->
% if ($Stylesheet) {
  <link rel="stylesheet" href="<% $Stylesheet %>" type="text/css" />
% }

allows one to add 'Stylesheet = "/path/to/stylesheet"' to the call to the header component on any given page. I've been using this to add some styles needed for some custom input forms I've been doing. A sample call at the top of one of my forms is:

   <& Elements/Header, Title => "Phone Install/Feature Change Request",
         Stylesheet => "$RT::WebPath/Forms/css/forms.css" &>


See also

CustomizingWithCallbacks