一直有人要搜索结果调用其他字段的信息 比如图片等等 一直忙没顾上 官方其实已经内置了一个内容读取器。
我们打开搜索的结果模板template\index_style\
你的模板目录\search\index\ pc_lists.htm
我们在{volist name="lists" id="rs"}
里面加代码就可以实现 比如我们在 {$rs.des} 下面加上
文雅点的加法:
{php}$show=fun('Content@info',$rs['id'],$rs['module']);{/php}
图片:{$show['picurl']} 关键词:{$show['keywords']}..... 你就会发现 {$show['我们的字段名']}
暴力型的加法:
{:fun('Content@info',$rs['id'],$rs['module'])\['keywords']} {:fun('Content@info',$rs['id'],$rs['module'])['picurl']}
推荐文雅的办法
大概就是这样调用的