You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Bruno Busco <br...@gmail.com> on 2010/04/03 17:11:37 UTC

Accessing context in htmlScreenMactoLibrary templates macros

Hi Devs!
Is there a way to access the context in the template macros that are defined
in the htmlScreenMacroLibrary.ftl file?

I mean, as far as I can see, all widget templates defined in
htmlScreenMacroLibrary.ftl only access variables that are passed as macro
parameters.
How can I access something different like <@ofbizUrl> or
${setRequestAttribute("portalPageId", portalPageId)}?.

Thank you for any help on this.
What I am trying to do is to proceed with
https://issues.apache.org/jira/browse/OFBIZ-3625

-Bruno

Re: Accessing context in htmlScreenMactoLibrary templates macros

Posted by Bruno Busco <br...@gmail.com>.
Thank you Scott.
You are right! I should move more things in the renderer and have only the
html in the macro.
-Bruno


2010/4/3 Scott Gray <sc...@hotwaxmedia.com>

> Hi Bruno,
>
> Macros only have access to the parameters that are passed in.
>
> Have you considered only handling the html portion in the macro and doing
> the screen render in the renderer?
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 3/04/2010, at 9:11 AM, Bruno Busco wrote:
>
> > Hi Devs!
> > Is there a way to access the context in the template macros that are
> defined
> > in the htmlScreenMacroLibrary.ftl file?
> >
> > I mean, as far as I can see, all widget templates defined in
> > htmlScreenMacroLibrary.ftl only access variables that are passed as macro
> > parameters.
> > How can I access something different like <@ofbizUrl> or
> > ${setRequestAttribute("portalPageId", portalPageId)}?.
> >
> > Thank you for any help on this.
> > What I am trying to do is to proceed with
> > https://issues.apache.org/jira/browse/OFBIZ-3625
> >
> > -Bruno
>
>

Re: Accessing context in htmlScreenMactoLibrary templates macros

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Hi Bruno,

Macros only have access to the parameters that are passed in.

Have you considered only handling the html portion in the macro and doing the screen render in the renderer?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 3/04/2010, at 9:11 AM, Bruno Busco wrote:

> Hi Devs!
> Is there a way to access the context in the template macros that are defined
> in the htmlScreenMacroLibrary.ftl file?
> 
> I mean, as far as I can see, all widget templates defined in
> htmlScreenMacroLibrary.ftl only access variables that are passed as macro
> parameters.
> How can I access something different like <@ofbizUrl> or
> ${setRequestAttribute("portalPageId", portalPageId)}?.
> 
> Thank you for any help on this.
> What I am trying to do is to proceed with
> https://issues.apache.org/jira/browse/OFBIZ-3625
> 
> -Bruno