[ZWeb] Re: [Zopeorg-webmaster] [Z3d] 420/ 1 Request "Nested metal:use-macro ignored if parent has value "default"" (fwd)

Chris Withers chris at simplistix.co.uk
Sat Jul 23 08:51:22 EDT 2005


I'm CCing a few other people, hopefully one of them will be able to help...

Chris

R. David Murray wrote:
> I'm no longer actively involved in zope3 development.  I'd like to get
> off this mailing list.  However, when I go to the collector monitor
> list I'm not listed as a subscriber.  Can you figure out why I'm
> getting these and get my name deleted?  Thanks.
> 
> ---------- Forwarded message ----------
> Date: Mon, 27 Jun 2005 14:59:42 -0400
> From: "Collector: Zope 3 ..." <jim at zope.com>
> To: nucleus <contact_tonico at yahoo.de>, klm <klm at i.am>, jim <jim at zope.com>,
>      chrism <chrism at plope.com>, ctheune <ct at gocept.com>, efge <fg at nuxeo.com>,
>      fdrake <fdrake at gmail.com>, janko <jh at comunit.de>,
>      magnus <magnus.heino at home.se>, mj <mj at zopatista.com>,
>      poster <gary at zope.com>, rdmurray <rdmurray at bitdance.com>,
>      srichter <srichter at cosmos.phy.tufts.edu>, sspickle <steve at spvi.com>,
>      stevea <steve at z3u.com>, tseaver <tseaver at palladion.com>,
>      philikon <philikon at philikon.de>, garrett <garrett at mojave-corp.com>,
>      tim_one <tim.one at comcast.net>, hdima <dima at hlabs.spb.ru>,
>      anguenot <ja at nuxeo.com>
> Subject: [Z3d] 420/ 1 Request "Nested metal:use-macro ignored if parent has
>     value "default""
> 
> Issue #420 Update (Request) "Nested metal:use-macro ignored if parent has value "default""
>  Status Pending, core/bug medium
> To followup, visit:
>   http://www.zope.org/Collectors/Zope3-dev/420
> 
> ==============================================================
> = Request - Entry #1 by nucleus on Jun 27, 2005 2:59 pm
> 
> If a 'metal:use-macro' is nested in another 'metal:use-macro' and the value of the outer 'metal:use-macro' is "default" the inner 'metal:use-macro' will be ignored.
> 
> An example:
> 
> <div metal:use-macro="default">
>   <div metal:use-macro="x">
>     This is not macro x.
>   </div>
> </div>
> 
> The example above should raise a KeyError exception as in the following case:
> 
> <div tal:content="default">
>   <div metal:use-macro="x">
>     KeyError
>   </div>
> </div>
> 
> Use case for this nesting technique: I could simply nest 'metal:use-macros' and "customize" only parts of a page that I want.
> 
> Illustrative example:
> 
> <html>
>   <head metal:use-macro="macros/head|default">
>     <title tal:content="title">A minimal page</title>
>   </head>
>   <body metal:use-macro="macros/body|default">
>     <div metal:use-macro="header|default">
>       Site header
>     </div>
>     <div metal:use-macro="macros/content|default">
>       Default content.
>     </div>
>     <div metal:use-macro="macros/footer|default">
>       Footer.
>     </div>
>   </body>
> </html>
> 
> And from a script:
> 
> page = some_page_object()
> page.title = 'Foo'
> page.macros.update(some_pt_macros)
> return page.render()
> 
> (Instead of writing "macros/name|default" in the template I could also use a 'Default' instance instead of a real macro for the value and simply write "macros/name")
> 
> --
> Tonico
> ==============================================================
> 
> _______________________________________________
> Zopeorg-webmaster mailing list
> Zopeorg-webmaster at zope.org
> http://mail.zope.org/mailman/listinfo/zopeorg-webmaster
> 

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-web mailing list