DEDE自定义搜索页调用自定义字段
今天在做网站的时候遇到一个小问题,查询结果需要展示自定义字段,顿时不知道怎么搞定了。
网上搜了搜找到一个合适的:
1。修改puls/advancedsearch.php文件,找到
$query = "select arctype.* FROM $addontable addon
left join dede2_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 dede2_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby";
2.在select后面增加"addon.*,"
修改后应该是
$query = "select addon.*, arctype.* from $addontable addon
left join dede2_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 dede2_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.字段名称/}就OK了
aaaaaaaa