Opened 6 years ago

Closed 7 months ago

#3180 closed enhancement (fixed)

[Patch] Allow info in template

Reported by: trac@… Owned by: olemis
Priority: low Component: ThemeEnginePlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11


---	2008-06-13 09:58:46.000000000 +1000
+++	2008-06-13 09:58:51.000000000 +1000
@@ -40,4 +40,6 @@
             add_stylesheet(req, 'theme/'+theme['css'])
         if theme and 'template' in theme:
   ['theme'] = os.path.basename(theme['template'])
+        if theme:
+  ['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 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.


Attachments (1)

t3180-info-in-template.diff (629 bytes) - added by otaku42 5 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by hrj

Confirming that this works!

comment:2 Changed 6 years ago by butterflow

+1 confirms that this works and fixes #3689

comment:3 Changed 6 years ago by szabi4@…

Works here too! And fixes #3689

comment:4 Changed 6 years ago by otaku42

I can also confirm that this patch works as expected with r3416 of the theme engine plugin. As stated by others before, it also fixes #3689.

comment:5 Changed 6 years ago by anonymous

it works so why doesn't mr code ranger incorporate it?

comment:6 Changed 6 years ago by coderanger

Been busy ;-)

comment:7 Changed 5 years ago by rjollos

  • Summary changed from Patch for allowing info in template to [Patch] Allow info in template

Changed 5 years ago by otaku42

comment:8 Changed 5 years ago by otaku42

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 7 months ago by olemis

  • Owner changed from coderanger to olemis

comment:10 Changed 7 months ago by olemis

  • Resolution set to fixed
  • Status changed from new to closed

In 13519:

ThemeEnginePlugin [ close #3180 ] : Theme info added in reqtheme_info?

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from olemis. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.