## 五、搜索模板
### 1.文章列表
**演示**
~~~
<#if rows?? && (rows?size>0)>
<#list rows as a>
<div class="news-li"><a target="_blank" href="${(a.show_urls)!}" class="left">${(a.title)!}</a><span class="right">${(a.showtime)?string("yyyy-MM-dd")}</span>
</div>
</#list>
</#if>
~~~
### 2.标题
**演示**
~~~
<div class="bar2">搜索"${(searchKey)!}"结果</div>
~~~
### 3.文章分页
**说明**
*需要拷贝指定的代码*
**在适当的位置引入以下html**
~~~
<!--html代码-->
<div class="pager" id="pager" style="text-align:center; padding-top:20px;"></div>
<!--js代码-->
<link type="text/css" rel="stylesheet" href="${contextPath}/res/common/css/laypage.css">
<script src="${contextPath}/res/common/js/laypage.js"></script>
<script src="${contextPath}/res/common/js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
laypage({
cont: 'pager',
pages: ${(total/limit+0.9999)?int},
curr: ${((offset/limit)?int) + 1}, //当前页
jump: function(e){
if (${((offset/limit)?int) + 1} != e.curr) {
var url = '${contextPath}/www/search.do?searchKey=${(searchKey)!}&siteId=${(website.id)!}&offset='+((e.curr-1)*${limit});
window.location.href = url;
window.event.returnValue = false;
}
}
});
});
</script>
~~~