最近一直很忙,都没时间整理SEO博客了,正在计划做一个社区,社区的做的情况如何暂时就不透露,希望大家多多关注我的SEO博客,可以告诉大家的是社区里面可以发外链,另外有发布消息以及SEO技术的专区,欢迎大家到时候来社区交流,
DedeCMS标签手册 各类标签代码说明
。由于工作要求所以最近在进行网站制作工作,逛百度的时候发现一个好东西,针对学习DedeCMS的同学大有帮助,这基本可以看做是一本字典的,各种标签的意思都有,另外以前发表的是DedeCMS调用标签的标签写法,这次则是每个单词的意思都列举出来了,非常全,分享给爱好学习DedeCMS的同学,希望能够帮上大家。
【arclist 标记】
这个标记是DedeCms最常用的一个标记,也叫自由列表标记,其中 hotart、coolart、likeart、artlist、imglist、imginfolist、specart、autolist 这些标记都是由这个标记所定义的不同属性延伸出来的别名标记。
功能说明:获取指定的文档列表
适用范围:封面模板、列表模板、文档模板
基本语法:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>arclist typeid<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> col<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> titlelen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> infolen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> imgwidth<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> imgheight<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> listtype<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> orderby<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> keyword<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}</span>
底层模板(InnerText)
{/dede:arclist}
属性说明:
[1] typeid='' 表示栏目ID,在列表模板和档案模板中一般不需要指定,在封面模板中允许用","分开表示多个栏目;
[2] row='' 表示返回文档列表总数;
[3] col='' 表示分多少列显示(默认为单列);
[4] titlelen='' 表示标题长度;
[5] infolen='' 表示内容简介长度;
[6] imgwidth='' 表示缩略图宽度;
[7] imgheight='' 表示缩略图高度;
[8] type='' 表示档案类型,其中空值、不使用这个属性或type='all'时为普通文档
§ type='commend'时,表示推荐文档,等同于 {dede:coolart}{/dede:coolart}
§ type='image'时,表示必须含有缩略图片的文档,等同于{dede:imglist}{/dede:imglist}、{dede:imginfolist}{/dede:imginfolist}
§ type='spec'时,表示专题,等同于标记{dede:specart}{/dede:specart}
以上属性值可以联合使用,如: type='commend image' 表示推荐的图片文档
[9] rderby='' 表示排序方式,默认值是 senddate 按发布时间排列。
§ rderby='hot' 或 rderby='click' 表示按点击数排列
§ rderby='pubdate' 按出版时间排列(即是前台允许更改的时间值)
§ rderby='sortrank' 按文章的新排序级别排序(如果你想使用置顶文章则使用这个属性)
§ rderby='id' 按文章ID排序
§ rderby='postnum' 按文章评论次数排序
§ rderby='rand' 随机获得指定条件的文档列表
[10] rderway='' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序。
[11] keyword='' 表示含有指定关键字的文档列表,多个关键字用","分开
[12] channelid='' 表示特定的频道模型ID,内置的频道:专题(-1)、文章(1)、图集(2)、Flash(4)、软件(3)
[13] limit='起始,结束' 表示限定的记录范围,row属性必须等于"结束 - 起始",mysql的limit语句是由0起始的,如 “limit 0,5”表示的是取前五笔记录,“limit 5,5”表示由第五笔记录起,取下五笔记录,使用了本属性后,row属性将无效。
[14] att='数值' 表示自定义属性值
[15] subday='天数' 表示在多少天以内的文档,通常用于获取指定天数的热门文档、推荐文档、热门评论文档等
[16] partsort='排列位数' 表示自动获得父栏目的所有子数中排列在第几位的栏目ID,标记为 {dede:autolist}{/dede:autolist} 时,使用本属性才有效。
底层模板字段:
ID(同 id),title,iscommend,color,typeid,ismake,description(同 info),writer,shorttitle,memberid
pubdate,senddate,arcrank,click,litpic(同 picname),typedir,typename,
arcurl(同 filename),typeurl,stime(pubdate 的"0000-00-00"格式),
textlink,typelink,imglink,image
其中:
textlink = <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"><a</span> <span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">href</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'arcurl'</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">></span>title<span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"></a></span> typelink = <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"><a</span> <span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">href</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'typeurl'</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">></span>typename<span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"></a></span> imglink = <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"><a</span> <span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">href</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'arcurl'</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">><img</span> <span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">src</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'picname'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">border</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'0'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">width</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'imgwidth'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">height</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'imgheight'</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">></a></span> image = <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword"><img</span> <span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">src</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'picname'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">border</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'0'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">width</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'imgwidth'</span><span class="sh_normal"> </span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">height</span><span class="sh_symbol">=</span><span style="color: rgb(0, 0, 255); font-weight: normal; font-style. normal; " class="sh_type">'imgheight'</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">></span>
字段调用方法:[field:varname/]
如:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>arclist infolen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'100'</span><span class="sh_cbracket">}</span> <span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>textlink<span class="sh_symbol">/]</span> <span class="sh_symbol"><</span>br<span class="sh_symbol">></span> <span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>info<span class="sh_symbol">/]</span> <span class="sh_symbol"><</span>br<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>arclist<span class="sh_cbracket">}</span>
注:底层模板里的Field实现也是织梦标记的一种形式,因此支持使用PHP语法,Function扩展等功能
如: 给当天发布的内容加上 (new) 标志
<span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>senddate runphp<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'yes'</span><span class="sh_symbol">]</span> <span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">$ntime</span> <span class="sh_symbol">=</span> <span style="color: rgb(0, 0, 0); font-weight: bold; font-style. normal; " class="sh_function">time</span><span class="sh_symbol">();</span> <span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">$oneday</span> <span class="sh_symbol">=</span> <span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_number">3600</span> <span class="sh_symbol">*</span> <span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_number">24</span><span class="sh_symbol">;</span> <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">if</span><span class="sh_symbol">((</span><span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">$ntime</span> <span class="sh_symbol">-</span> <span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">@me</span><span class="sh_symbol">)<</span><span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">$oneday</span><span class="sh_symbol">)</span> <span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">@me</span> <span class="sh_symbol">=</span> <span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"<font color='red'>(new)</font>"</span><span class="sh_symbol">;</span> <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">else</span> <span style="color: rgb(34, 95, 45); font-weight: normal; font-style. normal; " class="sh_variable">@me</span> <span class="sh_symbol">=</span> <span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">""</span><span class="sh_symbol">;</span> <span class="sh_symbol">[/</span>field<span class="sh_symbol">:</span>senddate<span class="sh_symbol">]</span>
--------------------------------------------------------------------------------------
【field 标记】
功能说明:用于获取特定栏目或档桉的字段值及常用的环境变量值
适用范围:封面模板、列表模板、文档模板
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>field name<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'字段名'</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
(2) 系统分配的field
板块模板:phpurl,indexurl,indexname,templeturl,memberurl,powerby,webname,specurl
列表模板:position,title,phpurl,templeturl,memberurl,powerby,indexurl,indexname,specurl,栏目表dede_arctype的所有字段
其中 position 为 “栏目一 > 栏目二” 这样形式的链接,title则为这种形式的标题
文档模板:position,phpurl,templeturl,memberurl,powerby,indexurl,indexname,specurl,id(同 ID,aid)
(3) 文档所有内容字段
档案dede_archives表 和 附加表的所有字段。
--------------------------------------------------------------------------------------
【channel 标记】
功能说明:用于获取栏目列表
适用范围:封面模板、列表模板、文档模板
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>channel row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> type<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}</span>
自定义样式模板(InnerText)
{/dede:channel}
(2)属性
[1] row='数字' 表示获取记录的条数(通用在某级栏目太多的时候使用,默认是 8)
[2] type = top,sun/son,self
type='top' 表示顶级栏目
type='son' 或 'sun' 表示下级栏目
type='self' 表示同级栏目
其中后两个属性必须在列表模板中使用。
(3)底层模板变量
ID,typename,typedir,typelink(仅表示栏目的网址)
例:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>channel type<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'top'</span><span class="sh_cbracket">}</span> <span class="sh_symbol"><</span>a href<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'[field:typelink /]'</span><span class="sh_symbol">>[</span>field<span class="sh_symbol">:</span>typename<span class="sh_symbol">/]</</span>a<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>channel<span class="sh_cbracket">}</span>
注:在没有指定typeid的情况下,type标记与模板的环境有关,如,模板生成到栏目一,那么type='son'就表示栏目一的所有子类
--------------------------------------------------------------------------------------
【type 标记】别名 onetype
功能说明:表示指定的单个栏目的链接
适用范围:封面模板、列表模板、文档模板
(1)语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>type typeid<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>type<span class="sh_cbracket">}</span>
(2)属性 typeid='栏目ID'
(3)底层模板变量
typename,typelink(仅表示栏目的网址)
--------------------------------------------------------------------------------------
【autochannel 标记】
功能说明:表示指定排序位置的单个栏目的链接
适用范围:封面模板、列表模板、文档模板
(1)语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>autochannel partsort<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>autochannel<span class="sh_cbracket">}</span>
(2)属性 partsort='栏目所在的排序位置'
(3)底层模板变量
typename,typelink(仅表示栏目的网址)
--------------------------------------------------------------------------------------
【mytag 标记】
功能说明:用于获取自定义宏标记的内容
适用范围:封面模板、列表模板、文档模板
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>mytag typeid<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> name<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> ismake<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
(2)属性
[1] typeid = '数字' 表示栏目ID,默认为 0,在没有设定的栏目没有定义这个名称的标记,会按如下搜索方式来搜索“先向上查找父栏目 -> 通用标记(typeid=0)的同名标记”。
[2] name = '' 标记名称。
[3] ismake = yes|no 默认为 no 表示mytag里的内容不包含其它封面模板的标记,yes则表示标记内容含有其它封面模板标记。
--------------------------------------------------------------------------------------
【vote 标记】
功能说明:用于获取一组投票表单
适用范围:封面模板
(1) 基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>vote id<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'投票ID'</span> lineheight<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'22'</span> tablewidth<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'100%'</span> titlebgcolor<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'#EDEDE2'</span> titlebackground<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> tablebgcolor<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'#FFFFFF'</span><span class="sh_cbracket">}</span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>vote<span class="sh_cbracket">}</span>
注:本标记直接生成投票的HTML表单,为了让你更方便修改其样式,建议在后台->投票管理的地方直接复制生成的HTML代码来使用。
--------------------------------------------------------------------------------------
【flink 标记】,等同 friendlink
功能说明:用于获取友情链接
适用范围:封面模板
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>flink type<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> col<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> titlelen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> tablestyle<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>flink<span class="sh_cbracket">}</span>
(2)属性
[1]type:链接类型,值:
a. textall 全部用文字显示
b. textimage 文字和图得混合排列
c. text 仅显示不带Logo的链接
d. image 仅显示带Logo的链接
--------------------------------------------------------------------------------------
[2]row:显示多少行,默认为4行
[3]col:显示多少列,默认为6列
[4]titlelen:站点文字的长度
[5]tablestyle: 表示
--------------------------------------------------------------------------------------
【mynews 标记】
功能说明:用于获取站内新闻
适用范围:封面模板
(1) 基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>mynews row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'条数'</span> titlelen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'标题长度'</span><span class="sh_cbracket">}</span>Innertext<span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>mynews<span class="sh_cbracket">}</span>
(2)属性
[1] row 新闻条数
[2] titlelen 标题长度
(3)底层模板变量
[field:title/]、[field:writer/]、
[field:senddate function="strftime('%y-%m-%d %H:%M',@me)"/](时间)、[field:body/]
--------------------------------------------------------------------------------------
【loop 标记】
功能说明:用于调用任意表的数据,一般用于调用论坛贴子之类的操作
适用范围:所有模板
(1) 基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>loop table<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">' sort='' row='' if=''}</span>
底层模板
{/dede:loop}
(2) 属性
[1] table 表示查询的数据表
[2] sort 用于排序的字段
[3] row 返回结果的条数
[4] if 查询条件
(3)底层模板变量
这个标记的底层模板变量即是被查询表的所有字段
例:获取Phpwind论坛的最新主题贴子
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>loop table<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'pw_threads'</span> sort<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'tid'</span> row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'8'</span> <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">if</span><span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}</span> •<span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>subject <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">function</span><span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"cn_substr('@me',30)"</span><span class="sh_symbol">/]</span> <span class="sh_symbol">([</span>field<span class="sh_symbol">:</span>lastpost <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">function</span><span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"date('m-d H:M','@me')"</span><span class="sh_symbol">/])</span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>loop<span class="sh_cbracket">}</span>
--------------------------------------------------------------------------------------
【channelartlist 标记】
功能说明:用于获取当前频道的下级栏目的内容列表
适用范围:封面模板
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>channelArtlist typeid<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_number">0</span> col<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_number">2</span> tablewidth<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'100%'</span><span class="sh_cbracket">}</span> <span class="sh_symbol"><</span>table width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"99%"</span> border<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"0"</span> cellpadding<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"3"</span> cellspacing<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"1"</span> bgcolor<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"#BFCFA9"</span><span class="sh_symbol">></span> <span class="sh_symbol"><</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"><</span>td bgcolor<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"#E6F2CC"</span><span class="sh_symbol">></span> <span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>type<span class="sh_cbracket">}</span> <span class="sh_symbol"><</span>table border<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"0"</span> cellpadding<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"0"</span> cellspacing<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"0"</span> width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"98%"</span><span class="sh_symbol">></span> <span class="sh_symbol"><</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"><</span>td width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'10%'</span> align<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"center"</span><span class="sh_symbol">><</span>img src<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'[field:global name='</span>cfg_plus_dir<span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'/]/img/channellist.gif'</span> width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'14'</span> height<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'16'</span><span class="sh_symbol">></</span>td<span class="sh_symbol">></span> <span class="sh_symbol"><</span>td width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'60%'</span><span class="sh_symbol">></span> <span class="sh_symbol"><</span>a href<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"[field:typelink /]"</span><span class="sh_symbol">>[</span>field<span class="sh_symbol">:</span>typename <span class="sh_symbol">/]</</span>a<span class="sh_symbol">></span> <span class="sh_symbol"></</span>td<span class="sh_symbol">></span> <span class="sh_symbol"><</span>td width<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'30%'</span> align<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'right'</span><span class="sh_symbol">></span> <span class="sh_symbol"><</span>a href<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"[field:typelink /]"</span><span class="sh_symbol">></span>更多<span class="sh_symbol">...</</span>a<span class="sh_symbol">></span> <span class="sh_symbol"></</span>td<span class="sh_symbol">></span> <span class="sh_symbol"></</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"></</span>table<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>type<span class="sh_cbracket">}</span> <span class="sh_symbol"></</span>td<span class="sh_symbol">></span> <span class="sh_symbol"></</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"><</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"><</span>td height<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"150"</span> valign<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"top"</span> bgcolor<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"#FFFFFF"</span><span class="sh_symbol">></span> <span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>arclist row<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"8"</span><span class="sh_cbracket">}</span> •<span class="sh_symbol"><</span>a href<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"[field:arcurl /]"</span><span class="sh_symbol">>[</span>field<span class="sh_symbol">:</span>title <span class="sh_symbol">/]</</span>a<span class="sh_symbol">><</span>br<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>arclist<span class="sh_cbracket">}</span> <span class="sh_symbol"></</span>td<span class="sh_symbol">></span> <span class="sh_symbol"></</span>tr<span class="sh_symbol">></span> <span class="sh_symbol"></</span>table<span class="sh_symbol">></span> <span class="sh_symbol"><</span>div style<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'font-size:2px'</span><span class="sh_symbol">></span> <span class="sh_symbol"></</span>div<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>channelArtlist<span class="sh_cbracket">}</span>
除了宏标记外,channelArtlist 是唯一一个可以直接嵌套其它标记的标记,不过仅限于嵌套
{dede:type}{/dede:type} 和 {dede:arclist}{/dede:arclist} 两个标记,
电脑资料
《DedeCMS标签手册 各类标签代码说明》(http://meiwen.anslib.com)。(2) 属性
[1]typeid=0 频道ID,默认的情况下,嵌套的标记使用的是这个栏目ID的下级栏目,如果你想用特定的栏目,可以用","分开多个ID。
[2]col=2 分多列显示
[3]tablewidth='100%' 外围表格的大小
--------------------------------------------------------------------------------------
【list 标记】
功能说明:表示列表模板里的分页内容列表
适用范围:仅列表模板 list_*.htm
(1)基本语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">list</span> col<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> titlelen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> infolen<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> imgwidth<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> imgheight<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> orderby<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span> pagesize<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_cbracket">}{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span><span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">list</span><span class="sh_cbracket">}</span>
(2)属性
[1]col 内容列数
[2]titlelen 标题长度
[3]infolen 内容摘要长度
[4]imgwidth 缩略图宽
[5]imgheight 缩略图高
[6]orderby 排序方式,有效的排序方式有 senddate、pubdate、id、click、lastpost、postnum ,默认为 sortrank
[7]pagesize 分页大小
(3)底层模板变量
ID(同 id),title,iscommend,color,typeid,ismake,description(同 info),postnum,lastpost,shorttitle
pubdate,senddate,arcrank,click,litpic(同 picname),typedir,typename,
arcurl(同 filename),typeurl,stime(pubdate 的"0000-00-00"格式),
textlink,typelink,imglink,image
注:list标记除了支持档案表的基本模板变量外,还支持附加表的字段,你可以在模型管理中知道附加表支持列表使用的字段有哪些。
--------------------------------------------------------------------------------------
【page 标记】
功能说明:表示分页页面的附加参数
适用范围:列表模板
语法:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>page pagesize<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"每页结果条数"</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
注:此标记在dedecms3.1中已经过期,dedecms3.1中直接把 pagesize属性加在 list 标记中,表示记录分页大小。
--------------------------------------------------------------------------------------
【pagelist 标记】
功能说明:表示分页页码列表
适用范围:列表模板
(1)语法
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>pagelist listsize<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'3'</span> listitem<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">''</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
(2)属性
[1] listsize 表示 [1][2][3] 这些项的长度 x 2
[2] listitem 表示页码样式,可以把下面的值叠加
index 首页
pre 上一页
pageno 页码
next 下一页
end 末页
option 下拉跳转框
例:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>pagelist listsize<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'3'</span> listitem<span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">'index pre pageno next end option'</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
--------------------------------------------------------------------------------------
【pagebreak 标记】
功能说明:表示文档的分页链接列表。
适用范围:仅文档模板。
语法:{dede:pagebreak/}
【prenext 标记】
功能说明:表示获取文档“上一篇/下一篇”的链接列表。
适用范围:仅文档模板。
(1)语法:{dede:prenext/}
(2)属性:
[1] get 获取连接类型(仅2007版),get='' 同V4显示横排的上下页连接, get='pre' 上一篇的连接 get='next' 下一篇连接
注:此标记默认为横向排列,如果你想用竖向排列,可以用
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>prenext <span style="color: rgb(165, 42, 42); font-weight: normal; font-style. normal; " class="sh_keyword">function</span><span class="sh_symbol">=</span><span style="color: rgb(255, 0, 255); font-weight: normal; font-style. normal; " class="sh_string">"str_replace(' 下一篇:','<'.'br'.' />下一篇:',@me)"</span><span class="sh_symbol">/</span><span class="sh_cbracket">}</span>
表示
--------------------------------------------------------------------------------------
【pagetitle 标记】
功能说明:表示获取文档的分页标题
适用范围:仅文档模板。
(1)语法:{dede:pagetitle style='select'/}
(2)属性:style. 表示分页标题的展示样式
select 表示下拉框、link 表示文字直接链接
--------------------------------------------------------------------------------------
【fieldlist 标记】
功能说明:获得附加表的所有字段信息。
适用范围:仅文档模板。
语法:
<span class="sh_cbracket">{</span>dede<span class="sh_symbol">:</span>fieldlist<span class="sh_cbracket">}</span> <span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>name<span class="sh_symbol">/]</span> <span class="sh_symbol">:</span> <span class="sh_symbol">[</span>field<span class="sh_symbol">:</span>value<span class="sh_symbol">/]</span> <span class="sh_symbol"><</span>br<span class="sh_symbol">></span> <span class="sh_cbracket">{</span><span class="sh_symbol">/</span>dede<span class="sh_symbol">:</span>fieldlist<span class="sh_cbracket">}</span>
--------------------------------------------------------------------------------------
【myad 标记】
功能说明:获取广告代码
适用范围:所有模板。
建议在广告管理模块中获取,在此不作描述。
帮上大家。
本文来源熊向阳SEO博客