[Zope] python expression in tal:attributes

Ferhat Ayaz ferhatayaz at yahoo.com
Wed Aug 30 07:32:27 EDT 2006


yes, you're right. With define it works. Below is the
same code with define. Thank you.
But now I have another problem (actually my main
problem). For instance,if you click more and more on
the link 'Catalog'. The URL grows up like 
http://localhost:8080/Site/Catalog/Catalog/Catalog/..../index.html
How can I say that the Catalog folder is just under
the Site folder?

   <ul>
    <li tal:define="links python:{
            'Catalog/index.html':'Catalog',
            'Users/index.html':'Users',
            'Orders/index.html':'Orders'}"
        tal:repeat="item links/items">
        <a href="" 
            tal:define="link python:item[0]"
            tal:attributes="href
string:${container/absolute_url}/${link}"
            tal:content="python:item[1]">link name</a>
    </li>
   </ul>

--- Andreas Jung <lists at zopyx.com> wrote:

> 
> 
> --On 30. August 2006 04:18:53 -0700 Ferhat Ayaz
> <ferhatayaz at yahoo.com> 
> wrote:
> 
> >
> > this is _of course_ not working because of
> > ${python:item[0]}. It's illegal.
> 
> Why don't you use a tal:define inside the same tag
> to bind the value of 
> this expression to a variable  and use this variable
> inside tal:attributes 
> instead?
> 
> -aj


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Zope mailing list