Thanks Paul, It's work perfectly. Greetings. Michael ----- Original Message ----- From: "Paul Winkler" <pw_lists@slinkp.com> To: <zope@zope.org> Sent: Thursday, August 14, 2003 4:20 PM Subject: Re: [Zope] get url for localfs objects
On Thu, Aug 14, 2003 at 03:10:16PM +0200, Michael Bleijerveld wrote:
Hi,
I am using the following statements for displaying links to Localfs objects.
<tr tal:repeat="files batch" > <td><input type="checkbox" name="ids:list" value="<dtml-var id>"></td> <td><a href="HOME_URL" tal:attributes="href python:getLink(id)" tal:content="files/id">HOME TITLE OR ID</a></td> <br> </tr>
However when I use the python script getLink I receive the following error. What's wrong ?
Several things. First, you're mixing tal and DTML. Second, you're not providing a namespace for getLink. Assuming that getLink is a python script that lives somewhere above this template, try this:
<tr tal:repeat="file batch" > <td><input type="checkbox" name="ids:list" value="id" tal:attributes="value file/id"></td> <td><a href="HOME_URL" tal:attributes="href python:container.getLink(file.id)" tal:content="file/id">HOME TITLE OR ID</a></td> <br> </tr>
Note several changes: - I changed "files" to "file" because it's only one at a time. - Everywhere you use id, it must be file/id (in python, file.id). - value="<dtml-var id>" won't work in TAL ;-) - getLink lives somewhere... I'm betting on container.getLink
--
Paul Winkler http://www.slinkp.com Look! Up in the sky! It's SPOT-WELDER X! (random hero from isometric.spaceninja.com)
_______________________________________________ Zope maillist - Zope@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 )