輸出純文本字段:[[${cn.channelName}]] 或者 th:text="${cn.channelName}"
循環遍曆文章(zhāng) th:each="no : ${cms.getContentList('channelId:' + channel.channelId + ',count:6,order:1')}" order 排序 count 條數 channelId 欄目id
輸出自(zì)定義字段文本 [[${cn.attr['屬性id']}]]
輸出自(zì)定義字段圖片 單圖[[${cn.attr['屬性id'][0].url}]] 多圖th:each="a : ${content.attr['屬性id']}" th:src="${a.url}"
引入靜(jìng)态資源标簽 例如(rú):<link rel="stylesheet" th:href="${ctx}+'/css/fullpage.css'">
引入頭部和尾部頁面 <th:block th:include="${res}+'/includes/header'" />
日(rì)期格式處理(lǐ) ${#dates.format(日(rì)期字段releaseTime, 'yyyy-MM-dd')}
跳(tiào)轉事(shì)件(jiàn)處理(lǐ) th:onclick="location.href='[(${a.url})]'"
輸出html文本語法 [(${content.text})]
聲明變量 th:with="p = ${cms.getContent('id:'+content.id+',order:1')}"
獲取數組長度 ${#arrays.length(d)}
遍曆友情鏈接 cms.getLinksList th:each="no : ${cms.getLinksList(linkSortId: 友情鏈接分(fēn)類id)}"
js代碼中嵌入标簽:
<script th:inline="javascript">
[# th:each="item, index: ${cms.getContentList('channelId:' + channel.channelId + ',count:6,order:1')}"]
</script>
面包屑導航:
<th:block th:each="cn,CnAttr : ${cms.getParentChannelList(channel.channelId)}">
<a th:href="${cn.url}">[[${cn.channelName}]]</a>
</th:block>