For tag nested loop instance selection, for tag nested instance

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.