Reference to Local Context of a Macro
I have a page. It includes a macro (some HTML) that is in a subfolder. This html needs to refer to an image file in the local context of the macro file (in the same subfolder). Is this possible? I cannot determine the correct path notation for it (template and here refer to the context of the main page template calling the macro). Edward
On Fri, Sep 13, 2002 at 11:33:47AM -0600, Edward Pollard wrote:
I have a page. It includes a macro (some HTML) that is in a subfolder. This html needs to refer to an image file in the local context of the macro file (in the same subfolder).
Is this possible? I cannot determine the correct path notation for it (template and here refer to the context of the main page template calling the macro).
You want container. container refers to the container of the actual source template, not the calling context. -- Paul Winkler "Welcome to Muppet Labs, where the future is made - today!"
On Friday, September 13, 2002, at 11:43 AM, Paul Winkler wrote:
Is this possible? I cannot determine the correct path notation for it (template and here refer to the context of the main page template calling the macro).
You want container. container refers to the container of the actual source template, not the calling context.
I always neglect to include all the things I try before mailing out in desperation :-) I tried container (tal:attributes="src container/filename/absolute_url"), and it does not work, breaking unless I have a copy of the graphic one level up (where the file calling the macro resides). So either a) container doesn't work as described here in this case, or b) I'm just using it wrong. See parenthetical code snippet to see if that is the case Thanks for your consideration... Edward
Edward Pollard <pollej@uleth.ca> wrote:
I have a page. It includes a macro (some HTML) that is in a subfolder. This html needs to refer to an image file in the local context of the macro file (in the same subfolder).
Is this possible? I cannot determine the correct path notation for it (template and here refer to the context of the main page template calling the macro).
That's a ZPT question, you should ask it on the ZPT list. But I believe what you want is not possible, as the macro execution is completely transparent to the TAL engine. Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
On Fri, Sep 13, 2002 at 10:21:51PM +0000, Florent Guillaume wrote:
Edward Pollard <pollej@uleth.ca> wrote:
I have a page. It includes a macro (some HTML) that is in a subfolder. This html needs to refer to an image file in the local context of the macro file (in the same subfolder).
Is this possible? I cannot determine the correct path notation for it (template and here refer to the context of the main page template calling the macro).
That's a ZPT question, you should ask it on the ZPT list.
But I believe what you want is not possible, as the macro execution is completely transparent to the TAL engine.
D'oh! That's what I missed. You're doing it in a macro... the macro is inserted in the context template before the TAL statements contained in the macro are evaluated. So the TAL statements never know that they came from a different container. -- Paul Winkler "Welcome to Muppet Labs, where the future is made - today!"
Edward Pollard writes:
I have a page. It includes a macro (some HTML) that is in a subfolder. This html needs to refer to an image file in the local context of the macro file (in the same subfolder). This is a major weakness of METAL (discussed several times in the ZPT mailing list).
There is no clean solution: You can access the image via "<foldername>/<imagename>". This will usually work due to acquisition. Dieter
participants (4)
-
Dieter Maurer -
Edward Pollard -
Florent Guillaume -
Paul Winkler