[Zope] TAL/SQL Problem

Phil Beardmore philip.beardmore at sunderland.ac.uk
Thu Apr 7 11:22:58 EDT 2005


Hi, hope you can help.

We are currently linking a webpage to an SQL database and are pulling in 
information via the tal:replace function.  This is working extremely 
well however one of our SQL fields is comma deliminated, and we want it 
to appear as a list.  We have accomplished this by using the following code:

<h1>Interests</h1>

<tal:x define="test2 result/interests"
       repeat="id python:interests.split(',')">
  <p><a href=""
     tal:attributes="href string:detail_html?id=$id"
     tal:content="result/interests"
 >Interests goes here</a></p>
</tal:x>

This works well, and each item of text is displayed as a list item.  
Only problem we have, is we want to be able to display the SQL text as 
the link name, but instead each link has the same link text which is the 
whole of the SQL string.

E.g.  The text in the interests field is:  Swimming,Badminton,Ice Hockey 
<detail_html?id=Swimming>

The code seperates the text via the comma, and displays a list item for 
each activity.  Only problem is, the link text for each activity is the 
same (Swimming,Badminton,Ice Hockey <detail_html?id=Swimming>).  Anyone 
got any ideas?

Hope you can understand what I am after.  An example page is at:

http://lash.sunderland.ac.uk/business/organisationandstaff/test/detail_html?id=10

Thanks
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: philip.beardmore.vcf
Type: text/x-vcard
Size: 254 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050407/97e09eb9/philip.beardmore.vcf


More information about the Zope mailing list