Hi; I'm trying to concatenate a <dtml-var> with a string. I have this poor attempt: <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)"> where *title_or_id* is (of course) the <dtml-var> and *_frame* is the string. How should I do this? TIA, BenO
Ben Ocean wrote:
Hi; I'm trying to concatenate a <dtml-var> with a string. I have this poor attempt: <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)"> where *title_or_id* is (of course) the <dtml-var> and *_frame* is the string. How should I do this?
you could try <dtml-var title_or_id>_frame or <dtml-var "_.string(title_or_id)+'_frame'"> ------------- Hannu
Why not <dtml-var title_or_id>_frame ? Andreas ----- Original Message ----- From: "Ben Ocean" <zope@thewebsons.com> To: <zope@zope.org> Sent: Saturday, November 10, 2001 19:33 Subject: [Zope] Concatenation
Hi; I'm trying to concatenate a <dtml-var> with a string. I have this poor attempt: <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)"> where *title_or_id* is (of course) the <dtml-var> and *_frame* is the string. How should I do this? TIA, BenO
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi; I'm trying to concatenate a <dtml-var> with a string. I have this poor attempt: <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)"> where *title_or_id* is (of course) the <dtml-var> and *_frame* is the string. How should I do this?
<dtml-var "_[title_or_id()+'_frame']"> This one was easy ;-) Explanation: titel_or_id is a method. If you want it to return a string, you have to CALL it (that's why you need the "()") ... Joachim
At 04:50 AM 11/11/01 +0100, you wrote:
Hi; I'm trying to concatenate a <dtml-var> with a string. I have this poor attempt: <dtml-var expr="_.string(title_or_id.'_frame')(_,_.None)"> where *title_or_id* is (of course) the <dtml-var> and *_frame* is the string. How should I do this?
<dtml-var "_[title_or_id()+'_frame']">
Thank you!
This one was easy ;-)
I know. I'm new. I think I'll always be new...
Explanation: titel_or_id is a method. If you want it to return a string, you have to CALL it (that's why you need the "()") ...
Thanks. BenO
participants (4)
-
Andreas Jung -
Ben Ocean -
Hannu Krosing -
Joachim Werner