For tag nested loop instance selection, for tag nested instance
Next,Light B2C e-commerce websitesUse nested loops to customize product display instances
Purpose: To display up to 18 items on one page, three items per line
Query
<! -- Query data and display list --> <esql module = base id = list> select we_id, we_num, title, price, sale_url, pubdate from co_sale inner join (select we_id as tmp_id from co_sale where catalog in @ {pPage: cs} order by pubdate desc limit @ {pPage: start}, @ {pPage: length }) as tm1 on tmp_id = we_id </esql>
Nested loop custom output
<for end="@{list:getLength}" step=3><TR valign=top> <for bags=list start="@{for:getSuffix}" end="@{int:@{for:getSuffix}+3}"><TD width="@{double:100/3}%"><call>show</call></TD> </for></TR><tr height=12><td colspan=10></td></tr></for>
Master cyclic slave
0To
@ {List: getLength}(Length of the schoolbag list), step size =
3That is, three items are displayed in each cycle. The sub-cycle schoolbag is
List, From
@ {For: getSuffix}(The current subscript of the main loop ).
@ {Int :@ {for: getSuffix} + 3}(The current subscript of the Main Loop + 3) ends, and <call>
Show</Call> display list schoolbags
Current subscript positionProduct
Effect
File inLight B2C e-commerce websitesUnder the site/eb directory (site/eb/list_c.htm), open it and try it yourself.
Download and description of light platform Resources
Platform free download: http://download.csdn.net/detail/tx18/8381859
Latest Development Manual download: http://download.csdn.net/detail/tx18/8411089
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please pay attention to the latestDevelopment Manual