velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Pfeifer" <>
Subject RE: Global variables
Date Wed, 31 May 2006 06:03:46 GMT
If I'd like to increase readability (in my example I only included two
of the total of five #set-directives), how should I do? It must be
possible somehow to change the $tempLink from within the if-block.

-----Original Message-----
From: trad-ex [] 
Sent: den 31 maj 2006 06:52
To: Velocity Users List
Subject: Re: Global variables

Hi, Daniel,

Try it below !

#set($tempLink = "$!preurl$tempLink$!pId")

Best Regards

>this must be a frequent question but I couldn't find an answer to it on
> website.
>I've got following velocity template:
>#set ($tempLink =
>#if ($pId)
>  #set ($tempLink = $tempLink + "&p=${pId}")
>#if ($preurl)
>  #set ($tempLink = $preurl + $tempLink)
>The fact of the matter is: Even though neither $pId or $preurl is null
>verified this and yes, it does enter the #if-blocks) the resulting
> is always
>The question is: Why don't the subsequent #set-directives change the
>of $tempLink?
>Thanks in advance,
>Daniel Pfeifer

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message