Appending to strings in Velocity

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Appending to strings in Velocity

Mcbride, Michael G.
Hi everyone,

 

I have a velocity script that generates a year based on certain
parameters, mostly the current month and year.  However, I have been
unable to recombine that year into a string that already has a month and
date for successful use in a pullContent call.  How do I append
variables onto strings in Velocity?

 

Thanks in advance,

 

Michael McBride

[hidden email]

 

Reply | Threaded
Open this post in threaded view
|

Re: Appending to strings in Velocity

David Torres-2
This way,

$set($appendedString = "${firstString}${secondString}")

Thanks,

David

On 1/29/08, Mcbride, Michael G. <[hidden email]> wrote:

>
>    Hi everyone,
>
>
>
> I have a velocity script that generates a year based on certain
> parameters, mostly the current month and year.  However, I have been unable
> to recombine that year into a string that already has a month and date for
> successful use in a pullContent call.  How do I append variables onto
> strings in Velocity?
>
>
>
> Thanks in advance,
>
>
>
> Michael McBride
>
> [hidden email]
>
>
>
>
>



--
David Torres
Lead Developer
www.dotmarketing.com
www.dotcms.org
Dotmarketing, Inc.
3059 Grand Avenue
Suite 440
Miami, FL 33133
T: 305.858.1422 x. 9278
F: 786.594.5288
Reply | Threaded
Open this post in threaded view
|

Re: Appending to strings in Velocity

Maria Ahues Bouza
In reply to this post by Mcbride, Michael G.
Hi Michael,

If you have two variables one for month and one for year, let's say you
have: $month and $year.
If you want to then use this for a pullContent into a string variable, you
could do this:

#set ($dateString = "${month}/${year}")

Thanks
Maria

On 1/29/08, Mcbride, Michael G. <[hidden email]> wrote:

>
>    Hi everyone,
>
>
>
> I have a velocity script that generates a year based on certain
> parameters, mostly the current month and year.  However, I have been unable
> to recombine that year into a string that already has a month and date for
> successful use in a pullContent call.  How do I append variables onto
> strings in Velocity?
>
>
>
> Thanks in advance,
>
>
>
> Michael McBride
>
> [hidden email]
>
>
>
>  
>



--
Maria Ahues Bouza
Project Manager, dotCMS Services & Support

www.dotmarketing.com
www.dotcms.org
T: 305.858.1422 x (9) 272
D: 786.594.5272
F: 786.594.5288