[Grok-dev] Re: Skinning/themeing
optilude at gmx.net
Sat May 19 17:04:44 EDT 2007
Martijn Faassen wrote:
> What I was thinking about is a design similar to XSLT templating (not
> rules-based XSLT).
> You'd have theme.pt. Or theme.genshi, or whatever. All these templating
> languages need to be supplied with a way to get information from xpath
> Then you write a match view that matches the whole dynamically rendered
> page. In the theme template, you use xpath expressions to fish out the
> bits from the dynamically rendered page and pull it into the layout.
That's basically Deliverance's model, yes.
> This can be combined with smaller rules where bits of pages are
> manipulated. XSLT offers both ways as well - rule based transformation
> and template-based transformation, and combinations thereof. I am just
> trying to think of a way that allows this kind of pattern with other
> templating languages.
> If I understand Martin correctly about deliverance, what deliverance
> offers beyond this is cleaner themes that just contain ids.
Deliverance is XSLT-like and xpath-based. I think our thoughts here are
converging, and we're basically just down to a discussion on which
patterns to promote, and how to promote them.
> this would require a different approach where the static HTML is being
> matched (on an id basis at least) as well, as Lennart describes.
Come to think of it, another benefit of Deliverance used in an
out-of-process fashion, or as WSGI filter, is that you can have common
look-and-feel across different things. For example, you could apply a
theme to both phpBB and Plone and a small Grok app. The OpenPlans guys
are doing stuff like that with custom Pylons apps, for example.
More information about the Grok-dev