文章标題 ${content.title}
文章路徑 ${content.url}
文章詳情内容 ${content.text}
浏覽量${content.views}
欄目id ${content.channelId}
文章排序值 order 0默認排序 1按發(fā)布時(shí)間正序 2按發(fā)布時(shí)間倒叙 3訪問量正序 4訪問量倒序
文章增加訪問量 [[${cms.addView(content.id)}]]
上/下一條 order:1上一條 2下一條 <div th:each="a : ${cms.getContent('id:'+content.id+',order:1')}" th:onclick="location.href='[(${a.url})]'">[[${a.title}]]
分頁示例:
<th:block th:with="p=${cms.getContentPage('channelId:' + channel.channelId + ',siteId:'+site.id+',pageNo:'+page+',count:10,order:2')}"> <div class="news-list"> <div class="news-item" th:each="no: ${p.rows}"> <div class="news-cover" th:onclick="location.href='[(${no.url})]'"> <img th:src="${no.cover}!=null?${no.cover}:${ctx}+'/img/index/cover-img.jpg'" /> </div> <div class="news-details"> <span th:onclick="location.href='[(${no.url})]'">[[${no.title}]]</span> <a> <span>[[${#dates.format(no.releaseTime, 'yyyy-MM-dd')}]]</span> <span class="views"><img th:src="${ctx}+'/img/index/eye.svg'" /><span>[[${no.views}]]</span></span> </a> </div> </div> </div> <th:block th:include="${res}+'/includes/page'" /> </th:block>