[@cms_channel_list parentId=c.id] [#list tag_list as c1]
[/@cms_channel_list] [/#list]
[/@cms_channel_list]
显示3层代码
${channel.name}显示栏目名字
[#if channel.parent?exists]
[#if channel.parent.parent?exists]
[#if channel.parent.parent.parent?exists]
[#else]
[@cms_channel_list parentId=channel.parent.parent.id] [#list tag_list as c]
[/@cms_channel_list] [/#list]
[/@cms_channel_list]
[/#if] [#else]
[@cms_channel_list parentId=channel.parent.id] [#list tag_list as c]
[/@cms_channel_list] [/#list]
[/@cms_channel_list]
[/#if] [#else]
[@cms_channel_list parentId=channel.id] [#list tag_list as c]
[/@cms_channel_list] [/#list]
[/@cms_channel_list] [/#if]
2.3栏目页栏目本月排行
栏目本月排行
[@cms_content_list channelId=channel.id count='10' titLen='15' orderBy='2' channelOption='1'] [#list tag_list as a]
${a.views!}
href=\[/#list]
[/@cms_content_list]
channelId=channel.id 切换到哪个栏目就显示哪个栏目下的新闻排行 三 新闻内容.html 3.1新闻内容
作者:${content.author!}
来源: [#if pagination.firstPage]
摘要: [@text_cut s=content.description len='50' append='...'/] [/#if]
[#if content.citedTitle?exists]引题:${content.citedTitle}[/#if] [#if content.editors?exists]编辑:${content.editors}[/#if]
[#if content.pictureEditors?exists]图片编辑:${content.pictureEditors}[/#if]
${txt!}
[#if pagination.firstPage]
[#if content.citedTitle?exists]引题:${content.citedTitle}[/#if] [#if content.editors?exists]编辑:${content.editors}[/#if]
[#if content.pictureEditors?exists]图片编辑:${content.pictureEditors}[/#if] ${content.releaseDate} 内容页发布时间 ${content.author!} 作者
来源 [@text_cut s=content.description len='50' append='...'/]摘要 3.2内容页翻页
如果内容过长需要设置翻页效果,需添加以下代码。 [#assign p=pagination/] [#if p.totalPage gt 1]
[#t/] [/#if]
[#list 1..p.totalPage as i]
[#if p.pageNo == i] [#if !p.lastPage] [#lt/] [/#if] [/#if] 3.3浏览次数 在点击次数后的里写入下面的代码 以上代码 放在 前 发布时间${content.releaseDate} 浏览次数:
id=\ 是必须的 但 span 可以换成 p 等其他标签 3.4上一篇下一篇
上一篇:
[@cms_content id=content.id next='1' channelId=channel.id][#if tag_bean??]
下一篇:
[@cms_content id=content.id next='0' channelId=channel.id][#if tag_bean??]
3.5文章内容页显示相关文章
要显示相关文章,前提还是在添加文章时”Tag标签处”填写tag关键字。 [#if content.tagStr??]
[@cms_content_list styleList='1-1' titLen='19' count='5' headMark='3' lineHeight='7' bottomLine='1' tagName=content.tagStr excludeId=content.id channelOption='1' emptyMsg='本文暂无相关文章' emptyStyle='color:red;margin:5px;' tpl='2'/] [#else]
本文暂无相关文章! [/#if]
3.6内容页颜色标签
[#if content.titleColor?exists]
[#else] [/#if]
[#if content.bold==true]
${content.title} [#else]
${content.title} [/#if]
3.7日顶踩(带修改没有测试通过)
[#if channel.allowUpdown] 顶
踩 [/#if]四 单页.html 4.1单页效果
点击一个栏目,例如学院简介,直接出现学校的介绍,而不是文章列表,
在内容添加时,要添加“单页”类型。在模板根目录下建立一个目录叫做alone 里面的模板叫做单页,单页的内容和内容一样,只是多了下面的代码
五 投票模块 5.1投票页
需要在内容管理系统后台手动添加一个投票,并把这个投票设置为默认,然后添加代码,代码加上完之后的前台效果如下图:
首页放置投票的地方添加如下代码
也可以在模板里新建一个叫做include的文件夹,在include下建立投票栏.html模板
在需要加投票代码的地方加上如下语句: [#include \投票栏.html\把下面的代码放到 投票栏.html中
[@cms_vote] [#if !tag_bean??]
没有默认投票主题 [#else]