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 *.xml are read when the application initializes, the resulting strings are passed to chameleon.PageTemplate, and the compiled templates are stored:

template['base'] = PageTemplate(read_file('base.xml'))
template['default'] = PageTemplate(read_file('default.xml'))

What is the best way for the 'default' template to refer to the 'base' template?

Regards, Nico

Op 10-08-15 om 18:13 schreef Malthe Borch:
Note that load is only available on file-based templates. Is that what you're using?
On Mon 10 Aug 2015 at 17:36 Nico Poppelier <[email protected]> wrote:
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

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="base">
  <head><title>TITLE</title></head>
  <body>
  <div metal:define-slot="content">content</div>
  </body>
</html>

Template 2: default.xml
<div metal:use-macro="load: base.xml">
  <div metal:fill-slot="content">
  <p>one article as content</p>
  </div>
</div>

The files base.xml and default.xml are in the same directory.

Any help is appreciated!


Nico

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to