网站栏目
Channel
属性:
栏目别名:
#[[ #(Channel.code) ]]#
#(Channel.code)
栏目图标:
#[[ #(Channel.icon) ]]#
#(Channel.icon)
栏目图片:
#[[ #(Channel.pic) ]]#
#(Channel.pic)
栏目标题:
#[[ #(Channel.caption) ]]#
#(Channel.caption)
栏目副标题:
#[[ #(Channel.subCaption) ]]#
#(Channel.subCaption)
栏目内容:
#[[ #(Channel.content) ]]#
#escape(Channel.content)
栏目页模板:
#[[ #(Channel.channelTemp) ]]#
#(Channel.channelTemp)
文章页模板:
#[[ #(Channel.contentTemp) ]]#
#(Channel.contentTemp)
栏目层级:
#[[ #(Channel.path) ]]#
#(Channel.path)
栏目序号:
#[[ #(Channel.sort) ]]#
#(Channel.sort)
方法:
返回栏目地址:
#[[ #(Channel.url()) ]]#
#(Channel.url())
根据别名返回指定栏目:
#[[ #(Channel.by("Index")) ]]#
#(Channel.by("Index").caption)
返回首页栏目:
#[[ #(Channel.index()) ]]#
#(Channel.index().caption)
返回父栏目:
#[[ #(Channel.parent()) ]]#
#set(parent = Channel.parent()) #if(parent != null)
#(parent.caption)
#else 没有父栏目 #end
返回子栏目列表:
#[[ #(Channel.children()) ]]#
#for(child : Channel.children())
#(child.caption)
#else 没有子栏目 #end
返回栏目下第一条文章:
#[[ #(Channel.first()) ]]#
#set(first = Channel.first()) #if(first != null)
#(first.caption)(#date(first.mdate, "yyyy-MM-dd"))
#else 该栏目没有文章 #end
返回栏目下最后一条文章:
#[[ #(Channel.last()) ]]#
#set(last = Channel.last()) #if(last != null)
#(last.caption)(#date(last.mdate, "yyyy-MM-dd"))
#else 该栏目没有文章 #end
返回栏目下文章列表(最多条数、是否倒序、是否包含子栏目):
#[[ #(Channel.list(10, true, true)) ]]#
#for(item : Channel.list(10, true, true))
#(item.caption)(#date(item.mdate, "yyyy-MM-dd"))
#else 该栏目没有文章 #end
分页返回栏目下文章列表(当前页码、每页条数、是否倒序、是否包含子栏目):
#[[ #(Channel.page(1, 10, true, true)) ]]#
#set(page = Channel.page(1, 10, true, true))
记录总数:#(page.totalRow)
总页数:#(page.totalPage)
每页条数:#(page.pageSize)
当前页:#(page.pageNumber)
#for(item : page.list)
#(item.caption)(#date(item.mdate, "yyyy-MM-dd"))
#else 该栏目没有文章 #end
返回文章标题中含有指定关键字的文章列表(关键字、是否倒序、是否包含子栏目):
#[[ #(Channel.search("章", true, true)) ]]#
#for(item : Channel.search("章", true, true))
#(item.caption)(#date(item.mdate, "yyyy-MM-dd"))
#else 没有搜索到相关文章 #end
栏目统计
Counter
方法:
整站统计(动态模式):
#[[ #(Channel.counter()) ]]#
#(Channel.counter())
整站统计(静态模式):
为元素增加
SITE-CNT-CHANNEL
样式类
在这里显示统计结果