jeff wrote:

[SNIP]
> Is that really something you envision as a commonplace need? 

I hope so.  I believe that the trend, nay stampede,  toward dynamic
content generation certainly makes this a possibility.

> Seems to
> me like the vast majority of templates are going to be hand crafted by a
> designer.  Not only that, but even if arbitrary text is used as source
> material, how often does \$ occur except in some sort of template
> language source?

It's the symbol of a major world currency, for starters...  the point is
really to try to 'do no harm.'

> 
> > Could you use #if() ? #if($foo) -> false if $foo not in the context.
> 
> I hadn't thought of that.  It's a bit ugly but it would work.

It's very ugly.  Christoph had a better solution.
 
[SNIP]

> 
> I was going to suggest something to turn off parsing temporarily but I
> searched my email archive and noticed that jvanzyl already added
> #literal

Hm.  If you have content you don't want parsed, just #include() it if
it's in a file.
 
> I am concerned though, because he gave this as an example:
> 
> > #literal()
> >
> > #if($skin)
> >     $!data.setLayoutTemplate($!skin.getLayout())
> >     $!page.setCss($!skin.getCss())
> > #end
> >
> > #end
> 
> This implies that parsing is still going on inside of the directive even
> if no substitution is being done.  If the above works, then the
> following could not possibly work:
> 
> #literal()
> 
> #if($skin)
>     $!data.setLayoutTemplate($!skin.getLayout())
>     $!page.setCss($!skin.getCss())
> #noend
> 
> #end
> 
> Perhaps #literal could be enhanced to allow this sort of usage:
> 
> #literal(ARBITRARY_END_MARKER_TEXT)
> 
> #if($skin)
>     $!data.setLayoutTemplate($!skin.getLayout())
>     $!page.setCss($!skin.getCss())
> #noend
> 
> ARBITRARY_END_MARKER_TEXT

We recognized that problem immediately, but it didn't seem terribly
pressing at the time. It's on the list :)

geir

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Reply via email to