模板标签在主题模板文件中使用,用来动态的显示内容或自定义网站。

如果您想要制作自己的主题或DIY模板,您需要了解这些标签。

标签列表(对应程序版本:1.2.0.0):

标签名称 说明 使用范围(默认为全局) 示例
全局
sitename 网站名称   ${sitename}
sitedescription 网站描述   ${sitedescription}
metakeywords 页面关键字   ${metakeywords}
metadescription 页面描述   ${metadescription}
footerhtml 页底HTML   ${footerhtml}
version 程序版本   ${version}
pagetitle 页面标题   ${pagetitle}
siteurl 网站URL   ${siteurl}
sitepath 网站路径   ${sitepath}
themepath 模板路径   ${themepath}
themeurl 模板URL(1.2新增)   ${themeurl}
head HTML标签中HEAD内多种标签的封装(1.2新增)   ${head}
isdefault 是否为首页   ${isdefault}
ispost 是否为文章页   ${ispost}
feedurl 订阅URL   ${feedurl}
feedcommenturl 订阅评论URL   ${feedcommenturl}
pager 分页   ${pager}
pagerindex 当前第几页   ${pagerindex}
url  当前URL   ${url}
date 当前日期   ${date}
archives 归档(集合)   ${archives}
searchkeyword 搜索关键字   ${searchkeyword}
querycount 数据库查询数次   ${querycount}
processtime 页面执行时间   ${processtime}
enableverifycode 是否使用验证码(值为1或0)  

#if($enableverifycode==1)

#end

文章
post 文章(实体) 文章页

post 实体对应的字段:

 

  1. ${post.postid}      ID
  2. ${post.slug}    别名
  3. ${post.title}    标题
  4. ${post.summary}  摘要
  5. ${post.content}   正文
  6. ${post.detail}    详情
  7. ${post.feeddetail}  订阅详情
  8. ${post.url}     URL
  9. ${post.link}   连接
  10. ${post.feedurl}  订阅URL
  11. ${post.feedlink}  订阅连接
  12. ${post.category}  对应分类(实体)
  13. ${post.author}   作者(实体)
  14. ${post.tags}    标签(集合)
  15. ${post.next}    下一篇(实体)
  16. ${post.previous}  上一篇(实体)
  17. ${post.relatedposts}  相关文章(集合)
  18. ${post.commentstatus}  是否允许评论
  19. ${post.commentcount}  评论数
  20. ${post.viewcount}    浏览数
  21. ${post.status}      状态
  22. ${post.recommend}    推荐
  23. ${post.topstatus}     置顶
  24. ${post.hidestatus}     隐藏
  25. ${post.createdate}    添加日期
  26. ${post.updatedate}    更新日期
posts  分页文章列表(集合) 文章列表页

这几种集合使用方法相同,例:

#foreach($item in $posts)
  ${item.title}
#end

recentposts 最近文章列表(集合)  
recommendposts 推荐文章列表(集合)  
topposts 置顶文章列表(集合)  
feedposts 订阅文章列表(集合) 订阅文章列表页
postmessage 文章列表信息(作者,分类等) 文章列表页 ${postmessage}
评论
comments 分页评论列表(集合)  文章页  

#foreach($item in $comments)
  ${item.title}
#end

recentcomments 最近评论列表(集合)    

#foreach($item in $recentcomments)
  ${item.title}
#end

commentauthor 发表评论时填写的名称   ${commentauthor}
commentemail 发表评论时填写的名称邮箱   ${commentemail}
commentsiteurl 发表评论时填写的名称网站   ${commentsiteurl}
commentcontent 发表评论时填写的名称内容   ${commentcontent}
commentmessage 发表评论时填写的提示   ${commentmessage}
其它
 tags(待定)      
 recenttags(待确定) 标签列表(集合)    

#foreach($item in $recenttags)
  ${item.name}
#end

categories 分类(集合)    

#foreach($item in $categories)
  ${item.name}
#end

authors 作者(集合)    

#foreach($item in $authors)
  ${item.link}
#end

links 所有连接(集合)    

#foreach($item in $links)
  ${item.link}
#end

navlinks 导航连接(集合)    

#foreach($item in $navlinks)
  ${item.link}
#end

generallinks 普通连接(集合)    

#foreach($item in $generallinks)
  ${item.link}
#end

统计
postcount 文章数   ${postcount}
commentcount 评论数   ${commentcount}
authorcount 作者数   ${authorcount}
viewcount 浏览数   ${viewcount}