企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[基础用法] 名称:type 功能:获取指定栏目信息 语法: ``` {eyou:type typeid='栏目ID' empty='暂时没有数据'} <a href="{$field.typeurl}">{$field.typename}</a> {/eyou:type} ``` 参数: typeid='' 指定栏目ID,如果没有指定则获取当前列表页的栏目ID type='self' 表示当前栏目 type='top' 表示当前栏目最顶级的一级栏目 addfields='content' 自定义字段名,多个字段以逗号隔开 empty='' 没有数据时显示的文案 id='' 可以任意指定循环里的变量名替代field,假设id='field1',模板调用如:{$field.typename} 变成 {$field1.typename} 底层字段: 请查阅易优Cms官方提供的数据字典,找到表名 ey_arctype -------------------------------效果展示-------------------------------- 调用指定栏目名称链接 模板调用代码 ``` {eyou:type typeid="1"} <li> <a href="{$field.typeurl}">{$field.typename}</a> </li> {/eyou:type} ``` 网站前端显示效果(css样式请自行填充) ![](https://www.eyoucms.com/uploads/allimg/180927/5-1P92GP1031P.png) 【更多示例】 -------------------------------示例1-------------------------------- 描述:输出单页模型栏目的详细内容 ``` {eyou:type typeid='10' type='self' addfields='content'} <a href="{$field.typeurl}">{$field.typename}</a> <!-- 截取内容250个字符串长度 start --> <span>{$field.content|html_msubstr=###,0,250}…</span> <!-- 截取内容250个字符串长度 end --> {/eyou:type} ```