> We developed a theme for use with the theme plugin but found some
> discrepancies within the code base.

I have found that the theme plugin is *very* useful for customizing
the basic trac look and feel, but doesn't necessarily wrest enough
control away from Trac if you are trying to do more fundamental
alterations to Trac's theming.

> For example, roadmap.css is loaded in the page body of the Roadmap
> page which masks the changes in the theme's css.

This is because the roadmap.css file is included via a genshi include
in the template.  If you override the template, it is trivial to
remove this line.

I've been fiddling with a theme for Trac that uses this technique.  I
have a custom trac plugin that implements ITemplateProvider and
IRequestFilter.  In the post_process_request method, I have code like
this:

def post_process_request(self, req, template, data, content_type):
    req.chrome['theme'] = 'blueprint-theme.html'
    if resource_exists('blueprinttheme', 'templates/blueprint-%s' % template):
        template = 'blueprint-%s' % template

     links = req.chrome.get('links')
     if links and 'stylesheet' in links:
          ... process stylesheets ...


Note the if resource_exists(...) line.  If trac has a template named
'ticket.html' and you have a template named 'blueprint-ticket.html',
then your template will be used.   This also gives you really fine
grained control over the markup, but only if/when you want it.  You
can also tweak stylesheets to your heart's content.  My plugin
provides a configuration directive to disable CSS files based on a
simple list.

> What is the recommended way to customise the trac look?
>
> Should we be modifying the css files in site-packages\trac\htdocs\css
> directly?

We should probably take this discussion off the dev list, though I
thought it worth pointing out how I've been able to do this.  I don't
know that it is considered best practice, but it's the most effective
solution I've found.

David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to