想在dedecmsCMS模板栏目列表页TAG列表页调用第一个文档相关信息,每一页的第一个文档相关信息,不是固定的
栏目列表页的实现方法
打开 /include/arc.listview.class.php 找到
//处理一些特殊字段 |
在它上面加入一句
if ($GLOBALS['autoindex'] == 1) { $GLOBALS['description'] = $row['description']; } |
TAG列表页的实现方法
打开 /include/arc.taglist.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)'/} |