[dokuwiki] Re: Plugin and Theme integration

  • From: Michael Klier <chi@xxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 28 Feb 2007 10:16:26 +0100

Martin Gill wrote:
> Hi all,
> 
> One of the things I noticed when I was creating my own theme was the
> problem of integrating plugins into my theme, each plugin may use it's own
> css and that upset what I was doing, because the colours would clash.

Hi,

in an ideal world all the plugin authors would use the set of default
style.ini replacements (__text__, __text_alt_, a.s.o.) in their plugin
CSS to make the plugin fit into any template, and all the template
authors would a least use this default set in their template, that`s
what the style.ini is for. But that`s, not yet, the case for all
plugins/templates.

> There are two things I would like to suggest for discussion.
> 
> The first is to allow plugins to have their own style.ini which is
> appended to the theme's style.ini. I suspect the style.ini replacement
> code is actually fairly slow though (not sure, as I've not looked at how
> it's parsed).

I doubt this would safe you from clashing colors, I think it would
rather lead to a more complicated situation as the plugin authors may
introduce their own substitutions. Also, since the CSS is cached after
it`s parsed the method is IMO fast enough.

> The ultimate aim would be to have a colour config plugin that would allow
> a each user (or just the admin) to actually completely customise the
> colours without having to edit a single file, and consequently without
> having to know anything about CSS or PHP.

If we would have the ideal situation mentioned earlier, it would be only
a matter of editing the style.ini to define personalized color scheme,
which doesn`t require any knowledge about CSS and PHP. I don`t know
if it would make sense to introduce some kind of admin plugin to do that
as you don`t change your template colors every day.

> It would read the merged colours array from the theme, adn all the plugins
> adn would allow the user to change the vales, then either store the
> overried as part of the cookie or in the main config file. That way even
> updates to plugins and themes would retain the users colour selections.

In regards to upgrade safeness - what about just checking for the
existence of another file local.style.ini in the template directory
before the CSS gets parsed, just like with all the other config files?
But we have to keep in mind that template authors may introduce or drop
replacements from time to time, which then must be handled by
lib/exe/css.php in some way.

Regards
chi

-- 
Michael Klier

mail:   chi@xxxxxxxxxxx
www:    http://www.chimeric.de
icq:    206179334
jabber: chi@xxxxxxxxxxxxx
key:    http://downloads.chimeric.de/chi.asc
key-id: 0x8308F551

Other related posts: