[Zope] Tip that I just learned that maybe some newbies might appreciate

Laura McCord Laura.McCord at doucet-austin.com
Tue Aug 31 11:58:06 EDT 2004


I have been struggling on learning everything about zope page templating
and I had some problems with how to construct something with
tal:attributes. With some help I learned about the semi-colon and how I
should have used two of them ';;' in my line of code.

So if you read the following thread maybe you will get something out of
it

Thanks.

-----Original Message-----
From: Garito [mailto:garito at sistes.net] 
Sent: Tuesday, August 31, 2004 10:34 AM
To: Laura McCord
Subject: Re: [Zope] question about string manipulation and
tal:attributes


Laura McCord wrote:

> Perfect!! :)
>  
> Thanks so much.
>  
> I will publish it on the mailing list.
>  
>  -----Original Message-----
> *From:* Garito [mailto:garito at sistes.net]
> *Sent:* Tuesday, August 31, 2004 10:26 AM
> *To:* Laura McCord
> *Subject:* Re: [Zope] question about string manipulation and
> tal:attributes
>
>     Laura McCord wrote:
>
>>I tried both ways, neither work.
>>The first way, <a href="#" onClick="expandIt('${resString}'); return 
>>false"> ...  directs me to the index page
>>
>>The second way, <a href="#" tal:attributes="onClick 
>>string:expandIt('${resString}'); return false">, is giving me an error

>>due to the return false. Specifically, it gives me:
>>
>>Error Type
>>KeyError 
>>Error Value 
>>'false' 
>>
>>maybe the second way is almost right but somehow I am not including 
>>that return false correctly.
>>
>>Thanks for your help. If you have any ideas feel free to share.
>>:)
>>
>>-----Original Message-----
>>From: Garito [mailto:garito at sistes.net]
>>Sent: Tuesday, August 31, 2004 10:10 AM
>>To: Laura McCord
>>Subject: Re: [Zope] question about string manipulation and
>>tal:attributes
>>
>>
>>Laura McCord wrote:
>>
>>  
>>
>>>onClick="expandIt('${resString}'); return false"
>>>
>>>Would this also work? Am I doing this right or would I have to do 
>>>this
>>>
>>><div tal:attributes="onClick string:expandIt('${resString}'); return
>>>false">
>>>
>>>Thanks.
>>>
>>>-----Original Message-----
>>>From: Garito [mailto:garito at sistes.net]
>>>Sent: Tuesday, August 31, 2004 9:58 AM
>>>To: Laura McCord
>>>Cc: zope at zope.org
>>>Subject: Re: [Zope] question about string manipulation and 
>>>tal:attributes
>>>
>>>
>>>Laura McCord wrote:
>>>
>>> 
>>>
>>>    
>>>
>>>>I need to concatenate strings is this a way I can do it? resString 
>>>>is
>>>>a
>>>>   
>>>>
>>>>      
>>>>
>>> 
>>>
>>>    
>>>
>>>>variable that contains a string.
>>>>
>>>><DIV tal:attributes="id string:$resString + 'Parent'">
>>>>
>>>>thanks.
>>>>_______________________________________________
>>>>Zope maillist  -  Zope at zope.org 
>>>>http://mail.zope.org/mailman/listinfo/zope
>>>>**   No cross posts or HTML encoding!  **
>>>>(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
>>>>http://mail.zope.org/mailman/listinfo/zope-dev )
>>>>
>>>>
>>>>   
>>>>
>>>>      
>>>>
>>>I use
>>><div tal:attributes='id string:${resString}Parent'>
>>>
>>>If you use string: zope assumes the sentence is a string and with ${}

>>>zope assumes you are referencing an object
>>>
>>>
>>>
>>> 
>>>
>>>    
>>>
>>Why not? Try it please!!!! :)
>>
>>
>>
>>  
>>
>     If you read the ZPT manual you could see ; is attribute separator
>     Then the correct way would be:
>     <div tal:attributes="onClick string:expandIt('${resString}')*;;*
>     return false">
>
>     With one ; you try to declarate 2 attributes:
>     1. onClick string:expandIt('${resString}')
>     2. return false
>
>     the line 2 says python you want to create an attribute called
>     return equals to object false (that is not defined in your 
> template)
>
>     I would like you publish in the list these conversation (perhaps
>     someone like you have the same problem)
>
Thank you!!!!!



More information about the Zope mailing list