Zope page templates and query strings
Any advice on the following problem accepted with thanks: I'm generating a list of data items in a zope page template.The data comes from an ZSQL method and successfully generates a list of items in the database however I have Compilation failures if I try the following: <a href="delete?isbn=<span tal:replace="list/isbn">"isbn"</span>">delete</a> the error returned is " TAL.HTMLParser.HTMLParseError: EOF in middle of construct," What I'm trying to do is construct a query string thus (where isbn is '1234567890'): <a href="delete?isbn=1234567890>delete</a> The delete object (another page template) is (I hope) a tal equivalent to a '<dtml-call delete>' <p tal:define="unused here/deleteMethod" tal:omit-tag=''> thanks in advance for any suggestions: Stu
Stuart Robinson wrote:
Any advice on the following problem accepted with thanks:
I'm generating a list of data items in a zope page template.The data comes from an ZSQL method and successfully generates a list of items in the database
however I have Compilation failures if I try the following:
<a href="delete?isbn=<span tal:replace="list/isbn">"isbn"</span>">delete</a>
the error returned is " TAL.HTMLParser.HTMLParseError: EOF in middle of construct,"
What I'm trying to do is construct a query string thus (where isbn is '1234567890'):
<a href="delete?isbn=1234567890>delete</a>
How's about something like: <a href="#" tal:attributes="href python:'delete?isbn?=%s' % list.isbn">delete</a> Untested, and may not be quite right... tim
On Mon, 2002-09-16 at 22:23, Tim Hicks wrote:
<a href="#" tal:attributes="href python:'delete?isbn?=%s' % list.isbn">delete</a>
Untested, and may not be quite right...
tim
<a href="#" tal:attributes="href python:'delete?isbn=%s' % list.isbn">delete</a> Thanks Tim: that did the trick... I just dropped that final '?' to make it work. Must go and read the chapter on python scripting in zope... putting a python format string in tal attributes just never occurred to me! Thanks again :-) Stu
Just to let you know it's invalid XHTML/HTML to put a <span> tag inside of a <a> tag like that. It's invalid to put any tages inside other like that ... nesting tags is fine ... but not 'inside' the tag ... On Mon, 2002-09-16 at 18:34, Stuart Robinson wrote:
On Mon, 2002-09-16 at 22:23, Tim Hicks wrote:
<a href="#" tal:attributes="href python:'delete?isbn?=%s' % list.isbn">delete</a>
Untested, and may not be quite right...
tim
<a href="#" tal:attributes="href python:'delete?isbn=%s' % list.isbn">delete</a>
Thanks Tim: that did the trick... I just dropped that final '?' to make it work. Must go and read the chapter on python scripting in zope... putting a python format string in tal attributes just never occurred to me!
Thanks again :-) Stu
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -- --EAM
Interlix - President/Owner Web Hosting - PC Service & Support Custom Programming - Network Service & Support http://www.interlix.com
Tim Hicks wrote:
<a href="#" tal:attributes="href python:'delete?isbn?=%s' % list.isbn">delete</a>
This is probably more efficient: <a href="#" tal:attributes="href string:delete?isbn=${list/isbn}">delete</a> Cheers, Evan @ 4-am
participants (4)
-
Edward Muller -
Evan Simpson -
Stuart Robinson -
Tim Hicks