You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Gary M. Catlin" <gc...@gmail.com> on 2009/05/15 02:39:02 UTC

Multi line text strings

Hello,

I am looking to implement new lines within a text string to simulate 
separate paragraphs.

In the code below, I am defining a local table structure with two 
columns; Control and CM.

#set ($RecCMs = [])

#set ($rec = { 'Control' : "Control1", 'CM' : "MyText1"}) #set ($n = 
$RecCMs.add($rec))
#set ($rec = { 'Control' : "Control2", 'CM' : "Mytext2"}) #set ($n = 
$RecCMs.add($rec))

I would like to replace the value of "MyText1" with a multi line string, 
such as the following:

1. Do this
2. Do that
3. Do the other

Eventually, I would like the entire content of $RecCMs.CM to be 
displayed in a table.

...
<td>$RecCMs.CM</td>
...

How do I go about defining the text string so that "new lines" are observed?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Multi line text strings

Posted by "Gary M. Catlin" <gc...@gmail.com>.
Thank you, Nathan. That first example did the trick.

Gary Catlin

Nathan Bubna wrote:
> #set ($rec = { 'Control' : "Control1", 'CM' : "1. Do this
> 2. Do that
> 3. Do the other"})
>
> Or, using the EscapeTool, you could do:
>
> #set ($rec = { 'Control' : "Control1", 'CM' : "1. Do this${esc.n}2. Do
> that${esc.n}3. Do the other"})
>
> On Thu, May 14, 2009 at 5:39 PM, Gary M. Catlin <gc...@gmail.com> wrote:
>   
>> Hello,
>>
>> I am looking to implement new lines within a text string to simulate
>> separate paragraphs.
>>
>> In the code below, I am defining a local table structure with two columns;
>> Control and CM.
>>
>> #set ($RecCMs = [])
>>
>> #set ($rec = { 'Control' : "Control1", 'CM' : "MyText1"}) #set ($n =
>> $RecCMs.add($rec))
>> #set ($rec = { 'Control' : "Control2", 'CM' : "Mytext2"}) #set ($n =
>> $RecCMs.add($rec))
>>
>> I would like to replace the value of "MyText1" with a multi line string,
>> such as the following:
>>
>> 1. Do this
>> 2. Do that
>> 3. Do the other
>>
>> Eventually, I would like the entire content of $RecCMs.CM to be displayed in
>> a table.
>>
>> ...
>> <td>$RecCMs.CM</td>
>> ...
>>
>> How do I go about defining the text string so that "new lines" are observed?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>   

Re: Multi line text strings

Posted by Nathan Bubna <nb...@gmail.com>.
#set ($rec = { 'Control' : "Control1", 'CM' : "1. Do this
2. Do that
3. Do the other"})

Or, using the EscapeTool, you could do:

#set ($rec = { 'Control' : "Control1", 'CM' : "1. Do this${esc.n}2. Do
that${esc.n}3. Do the other"})

On Thu, May 14, 2009 at 5:39 PM, Gary M. Catlin <gc...@gmail.com> wrote:
> Hello,
>
> I am looking to implement new lines within a text string to simulate
> separate paragraphs.
>
> In the code below, I am defining a local table structure with two columns;
> Control and CM.
>
> #set ($RecCMs = [])
>
> #set ($rec = { 'Control' : "Control1", 'CM' : "MyText1"}) #set ($n =
> $RecCMs.add($rec))
> #set ($rec = { 'Control' : "Control2", 'CM' : "Mytext2"}) #set ($n =
> $RecCMs.add($rec))
>
> I would like to replace the value of "MyText1" with a multi line string,
> such as the following:
>
> 1. Do this
> 2. Do that
> 3. Do the other
>
> Eventually, I would like the entire content of $RecCMs.CM to be displayed in
> a table.
>
> ...
> <td>$RecCMs.CM</td>
> ...
>
> How do I go about defining the text string so that "new lines" are observed?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org