You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Manish Khettry <ma...@bdnacorp.com> on 2002/05/30 21:02:06 UTC
Getting velocity to not interpret parts of a template file?
I have a template file, parts of which I would like velocity not to muck
around with; i.e
#leave_this_verbatim
some stuff
#end
#foreach( $x in $list)
#end
#set(..)
In this example, velocity would just leave everything between the two
directives exactly as they appear.
I was wondering if velocity had a directive to let me do that. I did a quick
search on the velocity page and nothing seemed quite right.
Thanks,
Manish
Re: Getting velocity to not interpret parts of a template file?
Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 5/30/02 3:02 PM, "Manish Khettry" <ma...@bdnacorp.com> wrote:
>
> I have a template file, parts of which I would like velocity not to muck
> around with; i.e
>
> #leave_this_verbatim
> some stuff
> #end
>
> #foreach( $x in $list)
> #end
>
> #set(..)
>
> In this example, velocity would just leave everything between the two
> directives exactly as they appear.
>
> I was wondering if velocity had a directive to let me do that. I did a quick
> search on the velocity page and nothing seemed quite right.
>
Well... There is a quasi-supported, undocumented directive called
'#literal()' which does this, as long as the 'stuff' is parseable VTL.
(That parseability requirement is why I'm not such a huge fan of it...)
Now, you could include the content with a #include(), which would let you
include anything you wished....
Would that work? I have the parser in pieces now, putting it back together
after fixing some things I wanted to fix for a while - I could look at
trying to let one write globbing directives if it's really needed...
--
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>