Home > Article > CMS Tutorial > How to call custom fields on DreamWeaver CMS search results page
1: Find and open the extend.func.php file in the include directory, and add the following code at the end of the file: cms)
function Search_addfields($id,$result){ global $dsql; $dedejs = $dsql->GetOne("SELECT * FROM `dede_addonsoft` where aid='$id'"); $name=$dedejs[$result]; return $name; }Among them, addosoft is an additional table to call the custom field. You can see it in the DreamWeaver backend core->Channel Model->Content Model Management. The software model is generally addonsoft. Ordinary articles are generally addonarticles. This can be changed according to specific needs. Others do not need to be modified.
2: Next, find and open the arc.searchview.class.php file in the include directory, search for "//Processing some special fields", and add the following code below:
$row["softsize"]=Search_addfields($row["id"],"softsize");The softsize is the field name of the software size. If there are multiple custom fields, add multiple lines, but the softsize must be changed to the field name. After adding it, it is completed. The last step is to call it in the search template. Use the [field:softsize/] tag in search.htm to call the software size
The above is the detailed content of How to call custom fields on DreamWeaver CMS search results page. For more information, please follow other related articles on the PHP Chinese website!