我需要的:
* consider product name
A.a
B.b
C.c
D.d
E.e
F.f
在转储项目数组上:
array(7)
{["id"]=> int(42172) ["Company_Website"]=> string(19) "http://www.xkl.com/"
["company_name"]=> string(3) "XKL" ["city_name"]=> string(8) "Kirkland"
["country_name"]=> string(3) "USA" ["comp_img"]=> NULL ["Product_Name"]=> string(24)
""Top End Transport System,Band Combiner Devices,Our Mid Level Transport System,The Introductory Transport System,In-Line Amplification Systems,Intelligent Ethernet Access System,Ethernet Access System,Intelligent Ethernet Access System (Ieas 05),Intelligent Ethernet Access System (Ieas 06),Intelligent Ethernet Access System (Ieas 03),Ethernet Aggregation Device""
}
这是我的tiwig文件:
<p class="prod">
{% if item.Product_Name.text[:5] %}
</p>
</div>
<div class="row flush nbdr pdt">
<div class="12u connect">
<p class="mr"><a href="#"><i class="icon icon-envelope"></i> Connect</a> <span>Booth # 50</span></p>
</div>
{% else if if item.Product_Name.text[:6] %}
<div class="row flush nbdr pdt">no data exist
</div>
{% endif %}
您可以使用SLICE
产品名称数组,例如如果item
包含产品,则可以
{% for i in item|slice(0, 5) %}
{{ i.Product_Name }}
{% endfor %}
这只会循环存储在item
array()中的5条记录
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句