💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 列表模板 ### 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> &gt; <!--首页--> <#if topCatalog.id!=catalog.id><a href="${(topCatalog.show_urls)!}">${(topCatalog.name)!}</a> &gt;<!--父级--> </#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> ~~~