[Zope] python expression in tal:attributes

Tino Wildenhain tino at wildenhain.de
Wed Aug 30 08:48:31 EDT 2006



--On Mittwoch, 30. August 2006 04:32 -0700 Ferhat Ayaz 
<ferhatayaz at yahoo.com> wrote:

>
> 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>

Why don't you better use python script to prepare your search
and results and use its return value (usually prepacked, preformattet
data in lists and dictionaries) instead?

Links to index.html are also extremly ugly. Why not just link
to the container?

Regards
Tino Wildenhain 


More information about the Zope mailing list