[Zope-CMF] Accessing PageMacros

Charlie Clark charlie at begeistert.org
Thu Mar 11 11:15:31 EST 2010


Am 11.03.2010, 16:19 Uhr, schrieb Andrew Sawyers <andrew at sawdog.com>:

> Heya Charlie,
> The way I do this is register a view for * with the name I'm using for  
> the
> macro:
> <browser:page
>     for="*"
>     name="foo"
>     permission="zope2.View"
>     template="../path/to/my_template.pt"
> />
> Then in in the template:
> <metal:foo use-macro="here/@@foo/macro_to_use">
> Not sure if that's the SOP or what...but works for me.

Hi,

I understand that and I've even had some success registering macros "the  
Zope 3 way" - although I'm not sure that I see any advantage this way to  
what you propose. However, zope.formlib.form.PageForm comes with it's own  
template which has macros and slots which I like to be able to use and the  
default __call__ will use this template or a replacement one defined in a  
View class template attribute. And it's creating a template that uses  
zope.formlib.form.default_page_template where I'm stuck.

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226


More information about the Zope-CMF mailing list