企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# pre 上一篇标签 ## 上一篇标签 用于内容详情页,显示当前文章的上一篇内容,调用此标签会自动生成a标签。 ## 格式 ``` <pre class="calibre16">``` <span class="token1">{</span>hkcms<span class="token1">:</span>pre target<span class="token">=</span><span class="token4">"_blank"</span> <span class="token">/</span><span class="token1">}</span> ``` ``` ## 参数 > 2.1.220220版本起,catid,id参数非必填项 参数名称可选值默认值是否必填说明catid栏目ID或变量--栏目ID,可以传入变量或指定IDid---文章IDtarget\_blank,\_self,\_parent,\_top--a 标签链接打开方式,target参数值原样生成到a标签上msg---当上一篇没有的情况下,显示的信息field-title-默认显示文章标题,你可以自定义要显示的字段len---限制标题长度dot---超出的标题尾部拼接字符## 示例 - 显示上一篇文章,如果没有了,就提示:**已经没有了** ``` <pre class="calibre16">``` <span class="token1">{</span>hkcms<span class="token1">:</span>pre msg<span class="token">=</span><span class="token4">"已经没有了"</span> <span class="token">/</span><span class="token1">}</span> ``` ``` html结果 ``` <pre class="calibre16">``` <span class="token"><</span>a href<span class="token">=</span><span class="token4">"/gnxw/rb/4.html"</span> title<span class="token">=</span><span class="token4">"叙永七旬夫妇,“砍”出两公里盐马古道"</span><span class="token">></span>叙永七旬夫妇,“砍”出两公里盐马古道<span class="token"><</span><span class="token">/</span>a<span class="token">></span> ``` ``` - 限制标题长度为10,并加上省略号 ``` <pre class="calibre16">``` <span class="token1">{</span>hkcms<span class="token1">:</span>pre len<span class="token">=</span><span class="token4">"10"</span> dot<span class="token">=</span><span class="token4">"...."</span> <span class="token">/</span><span class="token1">}</span> ``` ``` - 显示其他字段 ``` <pre class="calibre20">``` <span class="token1">{</span>hkcms<span class="token1">:</span>pre msg<span class="token">=</span><span class="token4">"已经没有了"</span> field<span class="token">=</span><span class="token4">"description"</span> <span class="token">/</span><span class="token1">}</span> ``` ```