POST TIME:2021-05-14 14:05
本期講解【Type 標記】,此標記主要用于指定單個欄目的鏈接,適用范圍:封面模板,列表模板,文檔模板。
一:使用說明
【Type 標記】的使用范圍是:封面模板(如:index_article.htm)、列表模板(如:list_article.htm)、文檔模板(如:article_article.htm)。 即對應templetsdefault文件夾下的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)中加入上述代碼后的顯示結果: