ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### 1.模板字符串截取 \[intercept 模板字符串截取\] @param string $str \[被截取的字符串 @param string $length \[截取长度\] @param string $end \[末尾拼接字符串\] 实例: <div class="media-body"> <h4 class="media-heading">{:intercept($news\['title'\], 20, '....')}</h4> <p>{:intercept($news\['summary'\], 80, '...')}</p> <span class="time">{$news.create\_time|date="Y-m-d",###}</span> </div> <div class="media-body"> <h4 class="media-heading">{:intercept($news\['title'\], 20, '....')}</h4> <p>{:intercept($news\['summary'\], 80, '...')}</p> <span class="time">{$news.create\_time|date="Y-m-d",###}</span> </div> #### 2.获取当前栏目父栏目信息 \[getSelfParentColumn 获取当前栏目父栏目信息\] @param \[type\] $field \[获取父栏目字段\] @return \[type\] \[description\] 实例: <div class="mod-title">{:get\_self\_parent\_column('title')}</div> <ul> <column:list name="column" pid="get\_self\_parent\_column('id')"> <li <eq name="column.name" value="$columnName">class="active"</eq>><a href="{$column.u rl}">{$column.title}</a></li> </column:list> </ul> <div class="mod-title">{:get\_self\_parent\_column('title')}</div> <ul> <column:list name="column" pid="get\_self\_parent\_column('id')"> <li <eq name="column.name" value="$columnName">class="active"</eq>><a href="{$column.u rl}">{$column.title}</a></li> </column:list> </ul> #### 3.获取指定栏目级别的父栏目的信息 \[get\_parents\_column 获取指定栏目级别的父栏目的信息\] @param \[type\] $level \[栏目级别\] @param \[type\] $field \[栏目字段\] @return \[type\] \[description\] 实例: <span class="sidebar-name">{:get\_parents\_column(3, "title")}</span>