AW: [Zope3-dev] use-macro in ZPTPage

Roger ineichen dev at projekt01.ch
Sun Mar 7 10:44:02 EST 2004


Jim Fulton wrote:
> Roger Ineichen wrote:
> > Is it possible to call use-macro in a ZPTPage (Page 
> > Template content type)? The global "views" isn't accessible. 
> > How can I call use-macro 
> > like the example below?
> > 
> > <html metal:use-macro="views/standard_macros/page">
> 
> Don't use "views". It is deprecared. Where did you
> find out about it?
The example above is used from the normal page templates
like the add.pt in zope.app.browser.container for to 
get the tempalte macro of the Rotterdam skin.
See:
http://cvs.zope.org/Zope3/src/zope/app/browser/container/add.pt?rev=HEAD&con
tent-type=text/vnd.viewcvs-markup

> Use container:
> 
>    metal:use-macro="container/@@standard_macros/page

This doesn't work, I get the following error message
in the textarea output if I use:
<html metal:use-macro="container/@@standard_macros/page">
---
<!-- Page Template Diagnostics
 Macro expansion failed
 exceptions.KeyError: 'container'
-->
<html metal:use-macro="container/@@standard_macros/page">
<body>
<div metal:fill-slot="body">
write this in the body slot.
</div>
</body>
</html>
--- 

What's callable global variables of a (ZPTPage) content instance?
Is the implementation the same like in Zope2?
Do we have changes? Or is "here" supported?

I'm confused about what's the different if I use a file
like add.pt and register them with a directive under the name "add.html"
and if I use the source code of the add.pt in a ZPTPage called add.html


Roger

> Jim
> 
> -- 
> Jim Fulton           mailto:jim at zope.com       Python Powered!
> CTO                  (540) 361-1714            http://www.python.org
> Zope Corporation     http://www.zope.com       http://www.zope.org
> 
> 
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org http://mail.zope.org/mailman/listinfo/zope3-dev
> 




More information about the Zope3-dev mailing list