Sorry, if this has question of mine has been posted already - i am really not
sure about the terminology used to search....

We are researching on usage of velocity at our place....we have setup
velocity with templates being loaded from databases, setup for using
the macros etc.

If the 'rendered' content has VTL code in it, I am curious, as to
how/whether we can support 'another pass' of velocity, ..as in,
user-generated content using system defined velocity macros.

example....

##define a macro to 'bold' the output text in bold.vm
#macro (bolder $text)
<b>$text</b>
#end

final template.....

Template (foo.vm)
-------------------

#parse ('bold.vm')

<html>

#bolder ('welcome john doe')

#foreach ($color in $colorlist)
  $color (<!--pardon any syntax error - and assume the pseudo code works)
#end 

</html>

The user maintains $colorlist (externally in a database as)  red, blue, #bolder
('green'), black, #bolder('yellow')  - and the expectation is that the list when
printed, would contain the text green and yellow in bold..(as per the #bolder
macro behavior) 

When the velocity engine is done with its work, #bolder (sometext) does
not get evaluated and it gets printed out as-is

This requirement is like the usage of macros in confluence (atlassian)
etc - just curious whether there are users who have used velocity for
this purpose. If there are - any best practises/things to watch out for
?

Are there other ways of handling such requirements ? 

p.s :  I have posted the same in google java groups and hope does not come
across as cross posting. 

http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/4e934e5f2636c90e


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to