Changes between Version 14 and Version 15 of TracInterfaceCustomization
- Timestamp:
- 07/11/2016 14:42:18 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracInterfaceCustomization
v14 v15 1 1 = Customizing the Trac Interface 2 3 2 [[TracGuideToc]] 4 3 [[PageOutline(2-5,Contents,pullout)]] … … 7 6 8 7 == Project Logo and Icon 9 10 8 The easiest parts of the Trac interface to customize are the logo and the site icon. Both of these can be configured with settings in [wiki:TracIni trac.ini]. 11 9 … … 17 15 18 16 === Logo 19 20 17 Change the `src` setting to `site/` followed by the name of your image file. The `width` and `height` settings should be modified to match your image's dimensions. The Trac chrome handler uses `site/` for files within the project directory `htdocs`, and `common/` for the common `htdocs` directory belonging to a Trac installation. Note that 'site/' is not a placeholder for your project name, it is the literal prefix that should be used. For example, if your project is named 'sandbox', and the image file is 'red_logo.gif' then the 'src' setting would be 'site/red_logo.gif', not 'sandbox/red_logo.gif'. 21 18 … … 29 26 30 27 === Icon 31 32 28 Icons are small images displayed by your web browser next to the site's URL and in the `Bookmarks` menu. Icons should be a 32x32 image in `.gif` or `.ico` format. Change the `icon` setting to `site/` followed by the name of your icon file: 33 29 … … 38 34 39 35 == Custom Navigation Entries 40 41 36 The new [mainnav] and [metanav] can now be used to customize the text and link used for the navigation items, or even to disable them, but not for adding new ones. 42 37 … … 107 102 Example snippets for `style.css` can be found at [trac:wiki:CookBook/SiteStyleCss CookBook/SiteStyleCss]. 108 103 109 If the environment is upgraded from 0.10 and a `site_newticket.cs` file already exists, it can be loaded using a workaround, provided it contains no [trac:ClearSilver] processing. In addition, as only one element can be imported, the content needs a wrapper, such as a `<div>` block or other similar parent container. The XInclude namespace must be specified to allow includes, but that can be moved to document root along with the others: 110 {{{#!xml 111 <form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')" 112 xmlns:xi="http://www.w3.org/2001/XInclude"> 113 <py:if test="req.path_info == '/newticket' and (not 'preview' in req.args)"> 114 <xi:include href="site_newticket.cs"><xi:fallback /></xi:include> 115 </py:if> 116 ${select('*')} 117 </form> 118 }}} 119 120 Also note that the `site.html`, despite its name, can be put in a shared templates directory, see the [[TracIni#inherit-section|[inherit] templates_dir]] option. This could provide easier maintenance (and a migration path from 0.10 for larger installations) as one new global `site.html` file can be made to include any existing header, footer and newticket snippets. 104 Note that the `site.html`, despite its name, can be put in a shared templates directory, see the [[TracIni#inherit-section|[inherit] templates_dir]] option. This could provide easier maintainence as one new global `site.html` file can be made to include any existing header, footer and newticket snippets. 121 105 122 106 == Project List #ProjectList