|
Re: Macros with large input on parameters: msg#00091jakarta.velocity.user
Nathan Bubna wrote: Jeremy said: Yeah, I think such a search reveals that Velocity doesn't have the feature the person is requesting. You cannot associate a nested block with a velocity macro. I think that's the feature the poster wants. Like, in FreeMarker, you could define the macro "thrice" like so: <#macro thrice> <#nested> <#nested> <#nested> </#macro> and then you could invoke it: <@thrice> blah blah </@thrice> and that would output: blah blah blah blah blah blah But the blah blah within the invocation could contain any arbitrary template text, including variable insertions, loops, and invocations of other macros and so on. And, of course the nested block could be a thousand lines long, if necessary. No problem. I notice that this idea has been floated separately on the Vel list and people thought it was interesting. But, as far as I know, it was never implemented -- mostly, I think, because of the lack of an active developer community. The only solution that comes to mind is to use a template engine that has the feature -- like,... ahem, FreeMarker. Here's the manual section that explains how this works: http://freemarker.org/docs/dgui_misc_userdefdir.html It could be of interest if someone wants to implement this idea. Best Regards and Greetings from the Dark Side, Jonathan Revusky -- lead developer, FreeMarker project, http://freemarker.org/
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Apache Tomcat/4.1.24 forumdemo/servlet_example1 not working: 00091, Reid Thompson |
|---|---|
| Next by Date: | Re: Macros with large input on parameters: 00091, Andrew Tetlaw |
| Previous by Thread: | Re: Macros with large input on parametersi: 00091, Nathan Bubna |
| Next by Thread: | Re: Macros with large input on parameters: 00091, Andrew Tetlaw |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |