logo       

Macros with large input on parameters: msg#00088

jakarta.velocity.user

Subject: Macros with large input on parameters

I am curious if it is possible to have macros with large input. I'll give a
simple example:

#macro (block $title $body)
<table class="Block">
<tr><td class="BlockTitle">$title</td></tr>
<tr><td class="BlockContents">$body</td></tr>
</table>
#end

Easy macro, but here's an example use:

#block ("Recent News" "........")

In the $body parameter, I would like to be able to run #foreach ... #end's,
have tables inside of it, etc... The code to generate the presentation of
Recent News might be 50 lines long.

<noflame_please>
In my perl days, using TemplateParser I could do something like:

[% BLOCK title="Recent News" %]
Here is all my code shiped to what would be the $body argument of the above
macro. This could be 1,000 lines long if necessary.
[% END %]
</noflame_please>

Is their a way to accomplish this?

Thank you,

Jeremy


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise