I'm trying to get template inheritance working they way it is described in
this thread, but get the error message below when I try to load the
templates: " LookupError: Unknown expression type: 'load'."
Template 1: base.xml
http://www.w3.org/1999/xhtml"; metal:define-macro="base">
TITLE
Malthe,
Thanks for the quick reply! I read the documentation twice to find
out what I was doing wrong. Did I miss a paragraph about load and
file-based templates?
Anyway: my application uses string-based templates. The contents
of all files *.x
OK, but isn't there a way to pass the
dictionary 'template' to the template 'default' such that this
template refers to the 'base' macro in template['base']?
Presently, the templates are read from a filesystem, but in future
I would like to be able to read them fr
On 8 May 2013 23:12, Mike Orr wrote:
> 'self' maps straightforwardly to Chameleon's slots, but how do you do the
> equivalent of 'next' and 'parent'? For instance, if some page templates want
> to put the base content in an unusual order, and others want to overrride it
> completely, but you don't
On Sat, May 4, 2013 at 12:21 AM, Malthe Borch wrote:
> Chameleon makes it pretty easy I'd say to use a site template:
>
>
>
> ${title}
> ...
>
>
>
> You can also use ``metal:extend-macro`` to make a linear
> specialization that keeps slots "fillable". For instance, you might
On Sat, May 4, 2013 at 12:21 AM, Malthe Borch wrote:
> On 4 May 2013 00:48, Mike Orr wrote:
> > Are there any good examples around of using Chameleon with a site
> template
> > macro?
>
> Chameleon makes it pretty easy I'd say to use a site template:
>
>
>
> ${title}
> ...
>
On 4 May 2013 00:48, Mike Orr wrote:
> Are there any good examples around of using Chameleon with a site template
> macro? I normally make my sites by inheriting from a Mako template that
> provides a standard and header/footer, with the page template
> overriding the title, possibly adding style
On 4 May 2013 00:50, Mike Orr wrote:
> Also, is there a way to make Chameleon put its compiled templates in a
> different directory from the source? On my server the source directory will
> be read-only at runtime. Or is there a command to precompile all templates
> in one step?
The CHAMELEON_CAC
I like Chameleon. But I dont like doing layout through macros. So I started
using "wrapper" feature of Pyramid. You just do "layout" view.
Then in view_config you specify wrapper="my_layout_view". Now in your view
template there is not any mention of layout, it is just template. And now
layout h
Have you looked at Jinja2 ? You can customize the escape characters so
that it nearly looks like Mako (or Moustache). Not sure if it suits your
other needs, but it has pretty decent template inheritance and macros.
I'm prototyping some 'user editable templates' with Jinja2 and the sandbox
mod
Or maybe I should just ask, what are the remaining things you can do in
Chameleon that you can't do in Mako? I'm interested in the well-formed XML
guarantee and Pyramid's Chameleon internationalization support. But on the
other hand the Chameleon syntax is so different it's a large learning
curve,
Also, is there a way to make Chameleon put its compiled templates in a
different directory from the source? On my server the source directory will
be read-only at runtime. Or is there a command to precompile all templates
in one step?
--
You received this message because you are subscribed to the
Are there any good examples around of using Chameleon with a site template
macro? I normally make my sites by inheriting from a Mako template that
provides a standard and header/footer, with the page template
overriding the title, possibly adding stylesheet and Javascript links,
supplying data for
13 matches
Mail list logo