dedecms搜索只有一个结果时直接跳转到结果文章页面

怎么实现,求大神

第1个回答  2017-09-20
1. 找到include/arc.searchview.class.php 文件 ,找到 Display()函数,添加如下判断

else if($tagname=="totalcount")
{
$this->dtp->Assign($tagid,$this->GetTotalResult());
} 2.外部添加GetTotalResult()函数,函数如下:

function GetTotalResult()
{
return $this->TotalResult;
}
3.模板中调用: [高级搜索模板/templets/default/advancedsearch.htm]search.htm,普通搜索,search_m.htm移动端搜索。
{dede:totalcount/}判断是否只有1条搜索结果,若是,则使用refresh刷新,打开{dede:field.arcurl/}追问

模板调用中的可以在详细点吗 {dede:totalcount/} 这个要怎么写 不是很会

本回答被网友采纳
相似回答