Home > CMS Tutorial > DEDECMS > body text

How to call custom fields on DreamWeaver CMS search results page

(*-*)浩
Release: 2019-11-29 13:20:26
Original
2065 people have browsed it

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;
}
Copy after login

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");
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template