freemarker嵌套循环怎么写
1个回答
展开全部
您好, 这样:
<#list listName as itemOut> <#--外层循环-->
<#list itemOut as itemIn> <#--内层循环-->
这里是你的内容
</#list>
</#list>
<#if typeProList?exists>
<#list typeProList[0..0] as each>
<#list each.proList[0..1] as product>
<div class="bot_right_pro_1">
<div class="pro_1_1"><a href="/huigou/s/product.shtml?method=productinfo&proid=${product.id }"><img src="/huigou<%=SConstants.CEM_UPLOAD_PRODUCT_PATH %>${product.picurl }" title="${product.name }" width="90" height="90"/></div>
<div class="pro_title"><a href="/huigou/s/product.shtml?method=productinfo&proid=${product.id }" title="${product.name}"><strong><shopping:TagUtil type="string" begin="0" end="5" target="${product.name}"/></strong></a></div>
<div class="pro_title"><img src="/huigou/images/huigou/icon_2.jpg" /><strong><span class="red">${product.hmprice }元</span></strong></div>
</div>
</#list>
</#list>
</#if>
<#list listName as itemOut> <#--外层循环-->
<#list itemOut as itemIn> <#--内层循环-->
这里是你的内容
</#list>
</#list>
<#if typeProList?exists>
<#list typeProList[0..0] as each>
<#list each.proList[0..1] as product>
<div class="bot_right_pro_1">
<div class="pro_1_1"><a href="/huigou/s/product.shtml?method=productinfo&proid=${product.id }"><img src="/huigou<%=SConstants.CEM_UPLOAD_PRODUCT_PATH %>${product.picurl }" title="${product.name }" width="90" height="90"/></div>
<div class="pro_title"><a href="/huigou/s/product.shtml?method=productinfo&proid=${product.id }" title="${product.name}"><strong><shopping:TagUtil type="string" begin="0" end="5" target="${product.name}"/></strong></a></div>
<div class="pro_title"><img src="/huigou/images/huigou/icon_2.jpg" /><strong><span class="red">${product.hmprice }元</span></strong></div>
</div>
</#list>
</#list>
</#if>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询