[Zope] - generating links from a database

Kiss, Arpad AKiss@GEOMETRIA.hu
Wed, 27 Jan 1999 10:31:13 +0100


 <000001be49be$216edc80$fe01a8c-@spot> wrote: 
Original Article: http://www.egroups.com/list/zope/?start=1528
> I'm building a site that is very much database driven. I'm trying to
> generate a list of items on one page with each item having a hyperlink to
> another page that will show detailed information for that item. I can create
> the pages, but I can't quite figure out how to pass the key value from the
> hyperlink to the query for the summary page.
> 
> This is the code I'm using to create the list of hyperlinked items in the
> "list of items" page:
> 
> <!--#in EventsByStateQuery -->
> <a href="EventSummary?EventID=<!--#var EventID -->">
> <!--#var EventName --></a><br>
> <!--#/in-->
> 
> This works well.
> 
> What I'm not successful at is passing the EventID to the second query. I've
> found I can hard code it as such:
> 
> <!--#in expr="EventSummaryQuery(EventID='1')" -->
> <!--#var EventName -->
> <!--#/in -->
> 
> But I can figure out how to pass the EventID dynamically.
> 
> Any guidance would be appreciated.
> 
> Jeff
> jeffniel@ix.netcom.com
> 
> 
> 
Hi,
I have an app with a similar functionality. Your second SQlMethod should
have a parameter(say par_EventID) and in this case your hyperlinks
generator code looks like this:
	<!--#in EventsByStateQuery -->
 	<a href="EventSummary?par_EventID=<!--#var EventID -->">
 	<!--#var EventName --></a><br>
 	<!--#/in-->
And your summary page:
	<!--#in EventSummaryQuery -->
	<!--#var EventName -->
	<!--#/in -->
Cheers,
Arpad

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Kiss Árpád
akiss@geometria.hu
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤