Or is there any other mechanism available to do so from within a
plugin?
I guess I could use a simple copy instruction like this:
#code
global-trac-template-folder = <function to get
global-trac-template-folder>
copy /templates/wiki.cs to global-trac-template-folder
alter permissions
but I would like to avoid this.
context: http://trac.edgewall.org/ticket/3704
.
--Noah
http://muness.textdriven.com/svn/edu/tags-plugin/trunk/tractags/web_ui.py
It provides an own template and an own implementation of the
wiki-module. This depends additionally on changing the ini file:
"
Update your trac.ini with the following:
[trac]
default_handler = TagsWikiModule
[components]
trac.wiki.web_ui.wikimodule = disabled
tractags.* = enabled
"
Any other simpler solution?
(if possible reversible, e.g. if the plugin is deactivated, the
original template should become active again)?
.
--Noah
Yes, this looks much better (although it seems that this would
additional overhead to _every_ request, but ok, it's a tiny one):
http://trac.edgewall.org/browser/trunk/trac/web/api.py#L486
.
I understand.
This would have the benefit to work with *.cs includes, too.
But I dislike to change the behaviour, as this could have side-effects
(e.g. on other plugins which work in a tricky way with the hdf).
Any other Idea?
> As a probably much cleaner way to do it, you can just make a request
> filter that does something like this:
> {{{
> def post_process_request(self, req, template, content_type):
> if template == 'wiki.cs':
> template = 'mytemplate.cs'
> return (template, content_type)
> }}}
this one works fine (except with *.cs includes)
.
--Noah
ok, will try with the available stuff and your hints.
thank's a lot!
.
I'm a little overworked at this point, and start to get confused with
this hdf thing. A little blindness gives the rest.
Is it ok if I munge this hdf.loadpaths within "post_process_request" ?
to the code:
def post_process_request(self, req, template, content_type):
...
loadpaths = <how do I retrieve the actual "load-paths" from within the
hdf>
loadpaths.insert(0, <my-path>
req.hdf = HDFWrapper(loadpaths)
I'm doing something wrong, but as said... blindness!
.
--Noah
I don't like Clearsilver.
(btw: I was overworked, you can see it from my suggestion, which
completely overwrites the hdf).
I have implemented it abstractly:
http://dev.lazaridis.com/base/changeset/48
.