属性列表
| 代码 |
名称 |
备注 |
| name |
缓存名称 |
zh.list.product |
| table |
表格 |
product,picture,news,download,list 等 |
| sort |
排序 |
DESC/ASC |
| rows |
数量 |
12 |
| where |
sql语法 |
调用案例,支持翻页
<div class="col-xs-12 col-sm-8 col-md-9" style="float:right"> <div class="list_box"> <h2 class="left_h"> {$data.name} </h2> <div class="product_list product_list2"> {php $s=0} {column=>("name"=>"zh.list.product","table"=>"product","sort"=>"DESC","rows"=>"{$config.web.list_product}","where"=>" pid=$data.id ")as $vo} {php $s++} <div class="col-sm-4 col-md-3 col-mm-6 product_img"> <a href="{@jmp('zh',$vo['static_url'])}"> <img src="{$config.setup.domain}{$vo.graph}" class="img-thumbnail" alt="{$vo.name}" /> </a> <p class="product_title"> <a href="{@jmp('zh',$vo['static_url'])}" title="{$vo.name}"> {$vo.name} </a> </p> </div> {/column} {if $s==0} <div class="col-sm-4 col-md-3 col-mm-6 product_img"> 没有找到栏目内容! </div> {/if} </div> {if $s>0} <div class="page"> {include:zh.page} </div> {/if} </div></div>
调用案例二,带搜索读GET参数
<div class="col-xs-12 col-sm-8 col-md-9" style="float:right"> <div class="list_box"> <h2 class="left_h"> 产品搜索 </h2> <div class="product_list product_list2"> {php $s=0} {column=>("name"=>"zh.product.soso","table"=>"product","sort"=>"DESC","rows"=>"12","where"=>" [ name LIKE '%$get.search%' or content LIKE '%$get.search%'] ") as $vo} {php $s++} <div class="col-sm-4 col-md-3 col-mm-6 product_img"> <a href="{@jmp('zh',$vo['static_url'])}"> <img src="{$config.setup.domain}{$vo.graph}" class="img-thumbnail" alt="{$vo.name}" /> </a> <p class="product_title"> <a href="{@jmp('zh',$vo['static_url'])}" title="{$vo.name}"> {$vo.name} </a> </p> </div> {/column} {if $s==0} <div class="col-sm-4 col-md-3 col-mm-6 product_img"> 抱歉没有搜索你要的内容! </div> {/if} </div> {if $s > 0} <div class="page"> <span href="#"> 共{$page.rows}条 </span> <span href="#"> 总{$page.pages}页 </span> <span href="#"> 第{$page.current}页 </span> {if $page.current > 1} <a href="{@jmp('zh','search',$page.current-1)}"> 上一页 </a> {/if} {page page as $i} {if $page.current == $i['number']} <span class="current"> {$i.number} </span> {else} <a href="{@jmp('zh','search',$i['number'])}"> {$i.number} </a> {/if} {/page} {if $page.pages != $page.current and $page.pages > 0} <a href="{@jmp('zh','search',$page.current+1)}"> 下一页 </a> {/if} </div> {/if} </div></div><!-- left --><div class="col-xs-12 col-sm-4 col-md-3"> <!-- <div class="left_nav" id="categories"> <h2 class="left_h">导航栏目</h2> </div> --> <div class="left_news"> <h2 class="left_h"> 新闻中心 </h2> {include:zh.news} </div> {include:zh.contact}</div></div>