[Zope] python expression in tal:attributes

Jens Vagelpohl jens at dataflake.org
Wed Aug 30 09:34:42 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 30 Aug 2006, at 15:26, Ferhat Ayaz wrote:

> Thanks to all. Now I extracted the links to a python
> script like
>
> url = container.Site.absolute_url()
> return {
>  url+'/Catalog/index.html': 'Catalog',
>  url+'/Members/index.html': 'Members',
>  url+'/Orders/index.html': 'Orders',
> }.items()
>
> and this works fine. index.html was just an example.
> I'll change the link names.
> But I'm still not so happy with this solution because
> I must change the line
>
> url = container.Site.absolute_url()

If you use the CMF or Plone there are other ways to get at the site  
URL without involving hardcoded object names. You can acquire the  
portal_url tool, calling it will give you the correct site url no  
matter what the site ID is.

jens


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE9ZPyRAx5nvEhZLIRAvFhAKCPeEwvleUej7R2860astL4u5dlfwCdEjqO
1DXZGcfdE69vDhlRC0D+Xrc=
=TY35
-----END PGP SIGNATURE-----


More information about the Zope mailing list