[Zope] Using folder name in macro

Philip Kilner phil at xfr.co.uk
Mon Mar 13 06:14:03 EST 2006


Hi John,

John Poltorak wrote:
> How do I use a folder name in a macro?
> 
> ie I want to change this 
> 
> <metal:macro metal:use-macro="context/abc.pt/macros/page">
> 

This is a path expression with a file (abc.pt) and path ("context/",
signifying the context of the call)...

> which is in the folder 'abc'
> 

...so you must have "/abc/abc.pt"

> to
> 
> <metal:macro metal:use-macro="context/[folder_name].pt/macros/page">
> 
> 

In your example, you seem to have confused the file and folder - I
suspect you want something more like: -

<metal:macro metal:use-macro="context/[folder_name]/abc.pt/macros/page">

...meaning "the macro "page" in the file "abc.pt" in the folder
"folder_name", with all the usual caveats about acquisition.

> I don't know where to look this sort of thing up.
> 

I generally start with the examples in the latest (?) Zope book (2.7) on
Plope.org. The reference is appendix C: -

	http://www.plope.com/Books/2_7Edition/AppendixC.stx

HTH!


-- 

Regards,

PhilK

Email: phil at xfr.co.uk
PGP Public key: http://www.xfr.co.uk
Voicemail & Facsimile: 07092 070518

"You'll find that one part's sweet and one part's tart:
say where the sweetness and the sourness start."
- Tony Harrison


More information about the Zope mailing list