Hmm. This bears several *ouch*:

1. The 
do<http://docs.pylonsproject.org/projects/pyramid/1.0/narr/templates.html#using-zpt-macros-in-pyramid>c
 
states, to reference a macro in a template that is defined in another 
template, the view has to put the referenced template into the available 
variables. Then, the view is involved in the page layout, which I dislike. 
The template should specify its layout and the view should only provide the 
data.

2. Besides looking cumbersome with that (define|use) (macro|slot) stuff, 
what I had in mind would render illegal XML. The inherited layout template 
should contain the complete page structure, including the opening HTML tag 
and the doctype. Afaiu all content I want to reference elsewhere has to be 
enclosed in a define-macro block. So the needed doctype and HTML tag had to 
be inside the define-macro block as well. But I cannot use the define-macro 
attribute, because its namespace is defined inside that block.

In mako this looks intuitive and easy:

templates/layouts/default.mak:
<!DOCTYPE html>
<html>
<body>${next.body()}</body>
</html>

templates/index.mak
<%inherit file="layouts/default.mak" />
<p>blah</p>

Or am I missing sth?

KR, drebbin

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to