[dokuwiki] Re: Template Switching Action

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 01 Aug 2006 13:47:32 +0100

Gerry Weißbach wrote:

I am aware about the fakt that the css.php and js.php are generated
without using lots of other wiki functions and therefore are dependent
on the $conf settings. I also know, that if I'd i.e. implement my code
to change this $conf into the local.protected.php it would work (I did
so for the older release) but I want a solution that is independent of
changing source code. Therefore I asked for an event which could easily
be implemented into the css.php
One of us seems to be missing the point.

Unless I have misunderstood, when you change the template, you necessarily call doku.php. You're action plugin can sit in there and happily work its magic on the template name in local.protected.php. Then when css.php and js.php get called, they will look for the cached version of the cs & js for the new template. If they don't find it, they'll generate a new one. Because the cache name is dependent on the template name there is no way they will use the css/js from another template.

If you're underlying problem is you wish to use a "foundation template" which changes the "actual template", then I would leave conf['template'] at the "actual template" value and modify the conf['template'] setting within dokuwiki to ensure your "foundation template" gets to do its stuff.

Personally, I'd be against adding events into cs & js generation, they should have to do as little work as possible.

Cheers,

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: