|
关于在搜索结果页中显示自字义字段的方法
如果通过“内容模型管理 > 自定义搜索”搜索的结果页如果要显示自定义字段,可使用以下方法:
1。修改puls/advancedsearch.php文件,找到
$query = "select arctype.* from $addontable addon
left join cmsxx_arctype arctype on arctype.id=addon.typeid
$where $orderby";
} else {
$query = "select main.id as aid,main.*,main.description as description1, type.*
from $maintable main
left join cmsxx_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby";
在select后面增加"addon.*,"
修改后应该是
$query = "select addon.*, arctype.* from $addontable addon
left join cmsxx_arctype arctype on arctype.id=addon.typeid
$where $orderby";
} else {
$query = "select addon.*,main.id as aid,main.*,main.description as description1, type.*
from $maintable main
left join cmsxx_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby";
注意,有两个地方要加
显示结果要修改模板文件,在plus/advancedsearch.htm,{dede:datalist}中直接调用{dede:field.字段名称/} 就好了。 |
|