Opened 17 years ago
Closed 11 years ago
#3180 closed enhancement (fixed)
[Patch] Allow info in template
Reported by: | Danial Pearce | Owned by: | Olemis Lang |
---|---|---|---|
Priority: | low | Component: | ThemeEnginePlugin |
Severity: | minor | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
--- web_ui.py.orig 2008-06-13 09:58:46.000000000 +1000 +++ web_ui.py 2008-06-13 09:58:51.000000000 +1000 @@ -40,4 +40,6 @@ add_stylesheet(req, 'theme/'+theme['css']) if theme and 'template' in theme: req.chrome['theme'] = os.path.basename(theme['template']) + if theme: + req.chrome['theme_info'] = theme return template, data, content_type
The above code block allows you to get at your theme info by using chrome['theme_info']['some_thing_you_want']
.
This allows you define extra stuff in your theme.py if you overload the get_theme_info() method, as I have done to allow for a color setting in a theme i will be uploading shortly. Without the above patch it will not be possible to use a different color of the same theme by simply putting a line in the trac.ini
It would be nice if you could apply the above patch, or have some other way of getting at the [theme] stuff from trac.ini in the template. Like how you can get at the footer/about info from there.
regards, Danial
Attachments (1)
Change History (11)
comment:1 Changed 16 years ago by
comment:4 Changed 16 years ago by
comment:7 Changed 15 years ago by
Summary: | Patch for allowing info in template → [Patch] Allow info in template |
---|
Changed 15 years ago by
Attachment: | t3180-info-in-template.diff added |
---|
comment:8 Changed 15 years ago by
The patch works fine with the current version of the 0.11 branch (r5930). I've also attached the patch, which should make it a bit easier to apply it.
comment:9 Changed 11 years ago by
Owner: | changed from Noah Kantrowitz to Olemis Lang |
---|
Confirming that this works!