JEECMS用法总结

1.循环打印栏目:

					[@cms_channel_list] 
						[#list tag_list as c]
						<li id="${c.path}"><a href="${c.url}">${c.name}</a></li>
						[/#list] 
					[/@cms_channel_list]

说明:${}是freemarker的语法。${c.url}代表栏目链接,${c.path}代表栏目路径名,${c.name}代表栏目名称


2.分页

 					[@cms_content_page count='4' sysPage='1' titLen='25' channelId = 71 append='...' orderBy='2' dateFormat='yyyy.MM.dd' channelOption='1']
          			    [#list tag_pagination.list as a]
 						<div class="news_piece">
							<div class="left_thumb"><a href="${a.url}"><img src="${a.typeImg!site.defImg}" width="140" height="120"></a></div>
							<div class="right_info">
								<!-- 标题长度不超过25个字 -->
								<h3><a href="${a.url}" style="font-size:18px;" title="${a.title}">[@text_cut s=a.title len=titLen append=append/]</a></h3>
								<span>${a.date?string(dateFormat)}</span>
 								<p>[@text_cut s=a.description len=100 append=append/]</p> <!-- 摘要长度不超过100字 -->
							</div>
						</div>
						<div class="title_separator">
							<div class="separate_line" style="background-color:grey;margin-bottom:15px;width:700px;"></div>
						</div>	         			    
          			    [/#list]
        			[/@cms_content_page]

(sysPage必须设置为1,1代表内容)

[@text_cut ... ] 用来裁剪文字内容,s存储文字内容,len表示裁剪后的长度,如果长度超过给定的数字,则用append来表示剩余的内容,如'...'。

a.typeImg表示类型图,可在CMS后台添加类型图,site.defImg表示默认图片,可在后台设置,!表示默认。


3.包含其他页面:

	[#include "../include/header.html"/]

4.查看可用属性:

在JEECMS后台的模型管理可查看或者添加属性,如author(作者),description(摘要)等。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值