Edgewall Software

Changes between Version 53 and Version 54 of TracInterfaceCustomization


Ignore:
Timestamp:
Aug 15, 2008, 4:47:15 PM (16 years ago)
Author:
meitarm@…
Comment:

Expound upon the virtues and dangers of how to perform page-level customization.

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v53 v54  
    180180   }}}
    181181
    182 == Customize Templates ==
    183 The template for pages are located in the trac/templates directory, e.g. /usr/lib/pythonVERSION/site-packages/Trac-VERSION.egg/trac/templates. The template for the main page is called 'theme'. The images can be found at htdocs, the css files at htdocs/css. If editing this files, please keep in mind that your changes may be lost on the next version update. To avoid this, make a copy of your files before beginning modifications.
     182== Project Templates ==
     183
     184The appearance of each individual Trac environment (that is, instance of a project) can be customized independently of other projects, even those hosted by the same server. For Trac 0.11, simply add and/or change the Genshi template files in that project environment's `templates` folder. For Trac 0.10, simply add and/or change the Clearsilver template files in that project environment's `htdocs` folder.
     185
     186For instance, if you are running Trac 0.11 and your project environment directory is `/srv/trac/myproject` then you can customize `myproject`'s appearance by changing the files found in `/srv/trac/myproject/templates`. For more information, read the `templates/README` file.
     187
     188To make template changes for all projects served by a single installation of Trac, modify the global templates at
     189
     190=== Caution: Do not make changes to the Trac installation egg ===
     191
     192Though possible, it is considered very bad practice to make global modifications by editing the Trac installation egg directly. Any changes you make here ''will be overwritten when you update your [TracInstall Trac install]'' and thus lost. The only way to prevent this from happening is to keep a current backup of your changes elsewhere.
     193
     194The default Trac templates are located in the egg's `trac/templates` directory (e.g., `/usr/lib/pythonVERSION/site-packages/Trac-VERSION.egg/trac/templates`). The [#ProjectList]'s template file is called `index.html` while the theme for the WikiStart page is called `theme.html`. Page assets such as images and CSS style sheets are located in the egg's `trac/htdocs` directory. Remember, ''your changes will be lost upon the next update you perform'' to your installation and you should thus use the method described in [#ProjectList], above, to effect global template customizations.
     195
    184196----
    185197See also TracGuide, TracIni