DedeCMS:模板制作教程第四期
本期讲解【Type 标记】,此标记主要用于指定单个栏目的链接,适用范围:封面模板,列表模板,文档模板。
一:使用说明
【Type 标记】的使用范围是:封面模板(如:index_article.htm)、列表模板(如:list_article.htm)、文档模板(如:article_article.htm)。 即对应templets\default\文件夹下的index_识别ID.htm模板、list_识别ID.htm模板、article_识别ID.htm模板。其中typeid为'栏目ID'。
栏目结构图:

二:测试实例
将下列代码放到主页模板文件index.htm中{dede:type typeid='3'} <a href='[field:typelink/]'>[field:typename/]</a> {/dede:type} {dede:channel} <a href='[field:typelink/]'>[field:typename/]</a> {/dede:type}
显示结果如下图所示:

注:与channel相比type则调用指定栏目链接,而channel则是调用一组栏目链接
在列表模板文件(list_article.htm)中加入上述代码后的显示结果: