## 列表模板
### 1.當前欄目對象catalog
**說明**
*catalog為當前欄目,根據需要調用相應的屬性,屬性參考首頁模板Catalog*
**演示**
~~~
<title><#if catalog?? && catalog!=''>${(catalog.name)!}</#if>-${(website.name)!}</title>
~~~
### 2.父級欄目對象topCatalog
**說明**
*topCatalog為當前欄目的上一級欄目,根據需要調用相應的屬性,屬性參考首頁模板Catalog*
**演示**
~~~
<!--該對象一般用在當前位置-->
<div class="lct">當前位置:
<a href="${contextPath}/www/index.do?id=${(website.id)!}">學校首頁</a> > <!--首頁-->
<#if topCatalog.id!=catalog.id><a href="${(topCatalog.show_urls)!}">${(topCatalog.name)!}</a> ><!--父級-->
</#if><a href="${(catalog.show_urls)!}">${(catalog.name)!}</a><!--當前位置-->
</div>
~~~
### 3.左邊子欄目列表subCatalogList
**說明**
*subCatalogList為List類型,其中存儲Catalog對象,屬性參考首頁模板Catalog*
**演示**
~~~
<#if subCatalogList?? && subCatalogList!=''>
<#list subCatalogList as m>
<a href="${(m.show_urls)!}" class="subnav-li">${(m.name)!}</a>
</#list>
</#if>
~~~
### 4.文章列表rows
**說明**
*需要判斷欄目是否為圖片欄目,rows對象存儲Article文章對象,屬性參考首頁模板Article*
**演示**
~~~
<#if catalog?? && catalog!=''>
<#if catalog.type==5> <!--如果當前欄目為圖片欄目-->
<#assign contentWidth=655>
<#assign liWidth=133>
<!--加載圖片欄目模板-->
<#include "/WEB-INF/ftl/www/common/picture_catalog.ftl"/>
<#else> <!--不為圖片欄目-->
<#if rows?? && (rows?size>0)> <!--rows對象存儲Article文章對象-->
<#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>
</#if>
</#if>
~~~
### 5.文章分頁
**說明**
*文章需要進行分頁,引入指定的 html代碼即可*
**引入html和JS**
~~~
<!--在適當的位置引入以下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/catalog.do?id=${(catalog.id)!}&siteId=${(website.id)!}&offset='+((e.curr-1)*${limit});
window.location.href = url;
}
}
});
});
</script>
~~~