AddCustomStyleSheet

From Request Tracker Wiki
Jump to: navigation, search

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