Including macros in header.ftl doesn't make those macros available for other
screens. What works quite well is something like this in header.ftl
        <#assign templateSrc = r"<#macro test>something here</#macro>" />
        <#assign template = templateSrc?interpret />
        ${request.setAttribute("template", template)}

Modify the files which want to use the macro "test" by inserting two line in
beginning and one line in the end as follows
<#assign template = requestAttributes.template />
<@template>
        .... file contents here
</@template>

Regards,
Vinay Agarwal


-----Original Message-----
From: tibor katelbach [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 19, 2006 1:59 AM
To: [email protected]
Subject: Re: FTL: Is there a way to have a global template of macros

Hi Vinay,

why not integrate it into your main decorator screen / widget definition
just like a header would be included everywhere.

<platform-specific><html><html-template
location="component://petitbateau/webapp/petitbateau/includes/macro.ftl"/></
html></platform-specific>

Regards
Tibor

On 7/18/06, Vinay Agarwal <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
>
> I created some FTL macros that I would like make available to all my 
> FTL templates. Is there a way to create a global template for FTL? I 
> tried
>
> 1. Screen.render: doesn't do it.
>
> 2. Include seems to work only for files placed in that directory (even 
> ../ etc. doesn't seem to work).
>
>
>
> Thanks in advance,
>
> Vinay Agarwal
>
>
>
>
>

Reply via email to