Discussion:
How to concatenate a string after tal:content=
Thomas G. Apostolou
2005-11-07 10:24:51 UTC
Permalink
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.

Thomas





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Nikos Papagrigoriou
2005-11-07 15:18:57 UTC
Permalink
Let's say you want to concatenate a variable (username) and the string "is
the best":

<p tal:content="string:${username} is the best"></p>

or

<p tal:content="python:username + ' is the best' "></p>

For more info:
http://plone.org/documentation/tutorial/zpt/advanced-usage
Post by Thomas G. Apostolou
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.
Thomas
--
Nikos Papagrigoriou <nikos-***@public.gmane.org>
http://www.papagrigoriou.gr
Thomas G. Apostolou
2005-11-07 16:24:10 UTC
Permalink
once again, Thank you Nikos

What i was trying to do (and i did not tell you) was to wite inside a repeat
structure write
<td tal:content="item/Cost">Cost</td>
and concatenate "item/Currency" after the "item/Cost" inside the <td></td>
tag.

I finaly managed to do so by:
<td><span tal:replace="item/Cost">Cost</span>
&nbsp<span tal:replace="item/Currency">Currency</span>&nbsp</td>

If there is a better way (i cannot see how i can do this the way you
propose) please tell me.
For example i tried
<td tal:content="string:${item/Cost} + string:${item/Currency}">Cost</td>
but did not work...

I also tried
<td tal:content="python:item/Cost + python:item/Currency">Cost</td> but did
not work either

Thanks again
Thomas Apostolou


"Nikos Papagrigoriou" <nikos-***@public.gmane.org> wrote
in message news:c29d1be0511070718va148418xa7a8472a966f8cb2-JsoAwUIsXouq+1Nelnf3ueG/***@public.gmane.org
Let's say you want to concatenate a variable (username) and the string "is
the best":

<p tal:content="string:${username} is the best"></p>

or

<p tal:content="python:username + ' is the best' "></p>

For more info:
http://plone.org/documentation/tutorial/zpt/advanced-usage


On 11/7/05, Thomas G. Apostolou <thomas.info-***@public.gmane.org>
wrote:
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.

Thomas




--
Nikos Papagrigoriou < nikos-***@public.gmane.org>
http://www.papagrigoriou.gr





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
david
2005-11-07 16:19:56 UTC
Permalink
Post by Thomas G. Apostolou
once again, Thank you Nikos
What i was trying to do (and i did not tell you) was to wite inside a repeat
structure write
<td tal:content="item/Cost">Cost</td>
and concatenate "item/Currency" after the "item/Cost" inside the <td></td>
tag.
<td><span tal:replace="item/Cost">Cost</span>
&nbsp<span tal:replace="item/Currency">Currency</span>&nbsp</td>
If there is a better way (i cannot see how i can do this the way you
propose) please tell me.
For example i tried
<td tal:content="string:${item/Cost} + string:${item/Currency}">Cost</td>
but did not work...
I also tried
<td tal:content="python:item/Cost + python:item/Currency">Cost</td> but did
not work either
Thanks again
Thomas Apostolou
Try:
<td tal:content="string:${item/Cost} ${item/Currency}">Cost</td>
that should work fine





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Christoph Berendes
2005-11-07 16:23:23 UTC
Permalink
<td tal:content="string:${item/Cost}${item/Currency}">Cost</td>

and
<td tal:content="python:item['Cost']+item['Currency']">Cost</td>

should work.
<pre wrap>once again, Thank you Nikos
What i was trying to do (and i did not tell you) was to wite inside a repeat
structure write
and concatenate "item/Currency" after the "item/Cost" inside the
tag.
&amp;nbsp&lt;span
If there is a better way (i cannot see how i can do this the way you
propose) please tell me.
For example i tried
&lt;td tal:content="string:${item/Cost} +
but did not work...
I also tried
&lt;td tal:content="python:item/Cost +
not work either
Thanks again
Thomas Apostolou
Let's say you want to concatenate a variable (username) and the string "is
or
http://plone.org/documentation/tutorial/zpt/advanced-usage
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.
Thomas
--
http://www.papagrigoriou.gr
-------------------------------------------------------
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Plone-Users mailing list
https://lists.sourceforge.net/lists/listinfo/plone-users
</pre></body>
</html>
</html>
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Thomas G. Apostolou
2005-11-08 10:44:38 UTC
Permalink
Thank you both,
<td tal:content="string:${item/Cost}${item/Currency}">Cost</td> works an is
surely better than
<td align="right"><span tal:replace="item/Cost">Cost</span>
&nbsp<span
tal:replace="item/Currency">Currency</span>&nbsp</td> i was using

<td tal:content="python:item['Cost']+item['Currency']">Cost</td> however
doesnot work


Another thing is how do i add a space after ${item/Currency}?
I use space as david does between ${item/Cost} and ${item/Currency} but it
does not work out.


Thank you very much.
Post by Christoph Berendes
<td tal:content="string:${item/Cost}${item/Currency}">Cost</td>
and
<td tal:content="python:item['Cost']+item['Currency']">Cost</td>
should work.
<pre wrap>once again, Thank you Nikos
What i was trying to do (and i did not tell you) was to wite inside a repeat
structure write
and concatenate "item/Currency" after the "item/Cost" inside the
tag.
&amp;nbsp&lt;span
If there is a better way (i cannot see how i can do this the way you
propose) please tell me.
For example i tried
&lt;td tal:content="string:${item/Cost} +
but did not work...
I also tried
&lt;td tal:content="python:item/Cost +
not work either
Thanks again
Thomas Apostolou
"Nikos Papagrigoriou"
in message
news:c29d1be0511070718va148418xa7a8472a966f8cb2-JsoAwUIsXouq+1Nelnf3ueG/Ez6Z
Post by Christoph Berendes
Let's say you want to concatenate a variable (username) and the string "is
or
http://plone.org/documentation/tutorial/zpt/advanced-usage
On 11/7/05, Thomas G. Apostolou
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.
Thomas
--
Nikos Papagrigoriou &lt;
http://www.papagrigoriou.gr
-------------------------------------------------------
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Plone-Users mailing list
https://lists.sourceforge.net/lists/listinfo/plone-users
</pre></body>
</html>
</html>
-------------------------------------------------------
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
J Cameron Cooper
2005-11-08 18:07:21 UTC
Permalink
Post by Thomas G. Apostolou
Thank you both,
<td tal:content="string:${item/Cost}${item/Currency}">Cost</td> works an is
surely better than
<td align="right"><span tal:replace="item/Cost">Cost</span>
&nbsp<span
tal:replace="item/Currency">Currency</span>&nbsp</td> i was using
<td tal:content="python:item['Cost']+item['Currency']">Cost</td> however
doesnot work
Depending on the object, you may need to use 'item.Cost' instead.
Post by Thomas G. Apostolou
Another thing is how do i add a space after ${item/Currency}?
I use space as david does between ${item/Cost} and ${item/Currency} but it
does not work out.
I think the trailing space is inserted, but you do not see it because
the browser does not render such things. Like in your original code, you
must use a non-breaking space entity to get the space rendered.

--jcc
Post by Thomas G. Apostolou
Post by Christoph Berendes
<td tal:content="string:${item/Cost}${item/Currency}">Cost</td>
and
<td tal:content="python:item['Cost']+item['Currency']">Cost</td>
should work.
<pre wrap>once again, Thank you Nikos
What i was trying to do (and i did not tell you) was to wite inside a repeat
structure write
and concatenate "item/Currency" after the "item/Cost" inside the
tag.
&amp;nbsp&lt;span
If there is a better way (i cannot see how i can do this the way you
propose) please tell me.
For example i tried
&lt;td tal:content="string:${item/Cost} +
but did not work...
I also tried
&lt;td tal:content="python:item/Cost +
not work either
Thanks again
Thomas Apostolou
"Nikos Papagrigoriou"
in message
news:c29d1be0511070718va148418xa7a8472a966f8cb2-JsoAwUIsXouq+1Nelnf3ueG/Ez6Z
Post by Christoph Berendes
Let's say you want to concatenate a variable (username) and the string
"is
Post by Christoph Berendes
or
http://plone.org/documentation/tutorial/zpt/advanced-usage
On 11/7/05, Thomas G. Apostolou
Hi all,
i am trying to to concatenate a string after tal:content=
how can this be done?
Thank you.
Thomas
--
Nikos Papagrigoriou &lt;
http://www.papagrigoriou.gr
--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Loading...