[pylons-discuss] Re: Chameleon macro examples

2015-08-10 Thread Nico Poppelier
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

[pylons-discuss] Re: Chameleon macro examples

2015-08-10 Thread Nico Poppelier
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

[pylons-discuss] Re: Chameleon macro examples

2015-08-10 Thread Nico Poppelier
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

Re: Chameleon macro examples

2013-05-10 Thread Malthe Borch
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

Re: Chameleon macro examples

2013-05-08 Thread Mike Orr
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

Re: Chameleon macro examples

2013-05-04 Thread Mike Orr
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} > ... >

Re: Chameleon macro examples

2013-05-04 Thread Malthe Borch
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

Re: Chameleon macro examples

2013-05-04 Thread Malthe Borch
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

Re: Chameleon macro examples

2013-05-04 Thread bismigalis
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

Re: Chameleon macro examples

2013-05-03 Thread Jonathan Vanasco
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

Re: Chameleon macro examples

2013-05-03 Thread Mike Orr
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,

Re: Chameleon macro examples

2013-05-03 Thread Mike Orr
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

Chameleon macro examples

2013-05-03 Thread Mike Orr
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