You'd have to hack Velocity to do it cleanly.  There's currently no
way to test that in the template.  RuntimeInstance has an
isVelocimacro(name, templateName) method, but it is not even exposed
in VelocityEngine, much less in the template.

On Tue, Sep 14, 2010 at 5:12 AM, Steve O'Hara
<[email protected]> wrote:
> We have a number of macro libraries that are used across projects.
> We need to change some of the 'general' macros so that they will
> optionally make a call to a 'project' macro if it exists.
> For example;
>
> #macro(outputLabel $Field)
>   #set ($Label=$Field.getLabel())
>   #if (#projectOutputLabel is Defined)
>       #projectOutputLabel($Field)
>   #end
>   $Label
> #end
>
> May be not a very good example but you get the idea.  Perhaps a way to
> implement it if there isn't a way already would be to enable the quiet
> syntax using the exclamation mark e.g.
>
> #macro(outputLabel $Field)
>   #set ($Label=$Field.getLabel())
>   #!projectOutputLabel($Field)
>   $Label
> #end
>
> Any ideas?
>
> Thanks,
>
> Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to