[Zope] How Do I "Structure" This?

Garito garito at sistes.net
Wed Aug 15 11:40:18 EDT 2007

In my opinion the correct sentence will be:

<a tal:attributes="href python: here.a_script(x)" />

But they are trying to say you that structure don't do anything here because
an anchor expect or a URL or a javascript

You are trying to put an html code into an anchor but this don't work on

If you want to execute the scritp when the user clicks on the anchor you
need to use something like:

<a tal:attributes="href <the url of the script>" /> -> <a
tal:attributes="href string:${here.a_script/absolute_url}?doc=${x}" />

and when the user clicks the anchor the script will be executed

can you find a reference help about HTML o xHTML with an anchor like this:

<a href="<html><body>your page here</body></html>" />

no, isn't it? then structure don't do nothing here...

2007/8/15, tonylabarbara at aol.com <tonylabarbara at aol.com>:
> I tried this:
> <a tal:attributes="href string:${here/a_script}?doc=${x}"> but got this
> error:
> *Error Type: TypeError
> Error Value: a_script() takes exactly 1 argument (0 given)*
> Next, I rewrote the script to put in a try statement for the variable, to
> test that, but before I even got to test I looked at the rendered code from
> the above line and it gave me this:
> <a href="&lt;html&gt;&lt;body&gt;nope&lt;/body&gt;&lt;/html&gt;?doc=0">
> So it doesn't look like the "string:${..." workaround worked :(
> And I don't think I need to URLquote.
> TIA,
> Tony
> -----Original Message-----
> From: Chris Withers <chris at simplistix.co.uk>
> To: tonylabarbara at aol.com
> Cc: lists at zopyx.com; zope at zope.org
> Sent: Wed, 15 Aug 2007 11:05 am
> Subject: Re: [Zope] How Do I "Structure" This?
>  Ah Tony,
> looks like the penny is yet to drop...
> tonylabarbara at aol.com wrote:
> > Bummer. Well, I'm trying to call a script that will render content to
> the Web, like this:
> > <a tal:attributes="href python:here.a_script(str(x))">
> My guess is that what you're _really_ trying to do here is:
> <a href=""
>  tal:attributes="href string:${here/a_script/absolute_url}?avar=${x}"/>
> ...but next you'll be wondering how to url quote x.
> I feel we're fighting a loosing battle here...
> Chris
> -- Simplistix - Content Management, Zope & Python Consulting
>   - http://www.simplistix.co.uk
>  ------------------------------
> AOL now offers free email to everyone. Find out more about what's free
> from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF00020000000437>.
> _______________________________________________
> 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 )

Mis Cosas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070815/0ba6dcfc/attachment.htm

More information about the Zope mailing list