|Version 4 (modified by 7 years ago) ( diff ),|
Trac Layout Recipe
The layout described below is ideal for Trac setups where one organization (e.g. Edgewall Software) offers multiple projects (e.g. Trac, Bitten, Genshi, etc.).
The first step is to prepare a
site.html template that will be used by all projects.
There are two ways to specify a
site.html template for an environment:
- Set the
[inherit]section of each
trac.inito a shared directory (e.g.
/path/to/common/templates), and save the
site.htmlfile in that directory. The
templates_dirmay also be specified in a global configuration that is included in each environment's configuration through the
fileoption in the
- Copy the
site.htmlfile to the
templatesdirectory of all environments, or better yet, create a symlink in all directories to a single common location.
The reference file is documented inline, so here is an abbreviated overview of the template:
- It begins by adding a CSS file to the head — make sure to update the URL if needed for your setup.
- It includes a list of topnav items as quick-jumps between projects — make sure to modify it to your specific project-list, as it is hardcoded.
- It includes a left box and right box that will appear on the left-hand side and right-hand side of each page. You can use these boxes for whatever you want (e.g. quick links, Google ads, etc.). An example for a left box is included in
templates/site_leftbox.htmlin the zip archive. There is no right box in the example.
- There is also a footer section for contact and copyright information, or anything else you like to put there.
Adjust the Site Style Sheet
projects.css stylesheet is included in the attached zip archive (under the
css directory), with the styles of the edgewall.org site. As with the site template, the stylesheet must also be accessible by each project environment. It may be placed in the directory specified by the
htdocs_dir option in the
[inherit] section of your
trac.ini file, or in the project environment's
You may modify the stylesheet to meet your artistic taste.
One important thing to note with respect to the
projects.css file is that it refers to various images used for backgrounds, gradients, etc.
The images are found in the
gfx directory of the attached zip archive, but the
projects.css file assumes that the images are available under the
../gfx directory, where
.. refers to one level up relative to the directory in which the
projects.css is located.
Make sure that one of the following is met:
gfxdirectory is visible, and is one level up relative to the
- All references to
projects.cssare replaced with a correct URL.
Note that the paths in this context are URLs, not filesystem paths.