想在 织梦cms 栏目 列表页 TAG列表页调用第一个文档相关信息,每一页的第一个文档相关信息,不是固定的,本文就来说说其实现方法
栏目列表页的实现方法
打开 /include/arc.listview.class.php 找到
//处理一些特殊字段
在它上面加入一句
if ($GLOBALS[ 'autoindex' ] == 1) { $GLOBALS[ 'description' ] = $row[ 'description' ]; }
TAG列表页的实现方法
打开 /include/arc. tag list.class.php 找到
//处理一些特殊字段
在它上面加入一句
if ($GLOBALS[ 'autoindex' ] == 1) { $GLOBALS[ 'description' ] = $row[ 'description' ]; }
上面2个PHP文件加的代码都是一样的,description 是第一个文档的摘要,如果要调用其他字段,你可以自己上。
例如 标题的 title ,关键词的 keywords ,等等...
if ($GLOBALS[ 'autoindex' ] == 1) { $GLOBALS[ 'title' ] = $row[ 'title' ]; $GLOBALS[ 'keywords' ] = $row[ 'keywords' ]; $GLOBALS[ 'description' ] = $row[ 'description' ]; }
前台模板调用标签写法
{dede:global.description function = 'html2text(@me)' /}
以上则是织梦CMS栏目列表页TAG列表页调用第一个文档相关信息的方法,有需要的朋友可以参考下。
原文地址:https://blog.csdn.net/caimao12/article/details/118158566
查看更多关于织梦CMS栏目列表页TAG列表页调用第一个文档相关信息的详细内容...