Hi I'm writing a procedure to build an HTML table. It takes two SQL queries A & B. A returns the actual data which will be displayed in the HTML table. B returns a set of records which dictates which columns in A to display. my pseudo-code is: for each record_in_A for each record_in_B display record_A[where column==column_B] next next I've no idea how it'll look like in Zope: <dtml-in query_A> <dtml-in query_B> <dtml-var sequence-item_A(sequence-item_B)> </dtml-in> </dtml-in> ??? So I think the questions I'm asking is 1. How do I reference individual members of a sequence-item 2. And how to do so in a nested dtml-in TIA - Jason Wong Digital View Ltd 2201 Nanyang Plaza 57 Hung To Road Kwun Tong HONG KONG Tel: +852-2861-3615 Fax: +852-2520-2987 www.digitalview.com
<dtml-in query_A> <dtml-in query_B> <dtml-var sequence-item_A(sequence-item_B)> </dtml-in> </dtml-in> ???
So I think the questions I'm asking is
1. How do I reference individual members of a sequence-item 2. And how to do so in a nested dtml-in
Use <dtml-let> to change the names of the sequence-items like this: <dtml-in query_A> <dtml-let a_seqitem="_['sequence-item']"> <dtml-in query_B> <dtml-var a_seqitem> <dtml-var sequence-item> </dtml-in> </dtml-let> </dtml-in> -- Stephen Pitts smpitts@midsouth.rr.com
Thanks, I've got it working now! - Jason Wong
Use <dtml-let> to change the names of the sequence-items like this: <dtml-in query_A> <dtml-let a_seqitem="_['sequence-item']"> <dtml-in query_B> <dtml-var a_seqitem> <dtml-var sequence-item> </dtml-in> </dtml-let> </dtml-in> -- Stephen Pitts smpitts@midsouth.rr.com
participants (2)
-
Jason Wong -
Stephen Pitts