Thanks Vincent.  One more question - is it possible to execute an XWiki 2.0
macro from Velocity context?

On Tue, May 5, 2009 at 4:46 PM, Vincent Massol <vinc...@massol.net> wrote:

> Hi Lewis,
>
> On May 5, 2009, at 9:11 AM, Lewis Denizen wrote:
>
> > Hi xwiki-users,
> >
> > Just wondering if it's possible to add a macro inside a code macro?
> > What I
> > want to do is something like this:
> >
> > {{code language="sql"}}
> > select *
> > from xyz
> > where from_date = '{{date-macro date="-1b" format="yyyyMMdd"/}}' --
> > The
> > date-macro returns the last business date in yyyyMMdd format
> > {{/code}}
>
> If by adding you mean execution it, then no it's not possible since
> it's not the goal of the code macro. The code macro is supposed to
> render its content as is without any interpretation (only syntax
> coloring).
>
> However if what you want is to execute some stuff you can use this
> trick:
>
> {{velocity}}
> {{code}}
> ...
> Some velocity code here that will be executed, including a velocity
> macro
> ...
> {{/code}}
> {{/velocity}}
>
> Thanks
> -Vincent
>
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to