Home > CMS Tutorial > Empire CMS > body text

One trick to solve the method of filtering the price range by custom fields in Empire CMS

silencement
Release: 2019-11-28 13:46:51
forward
2476 people have browsed it

One trick to solve the method of filtering the price range by custom fields in Empire CMS

Many webmasters often need to query and display results based on a certain range when building a website. This article uses Imperial CMS custom fields to implement price area range filtering to describe how to achieve this function. method.

The specific steps are as follows:

Customize the field gprice, and in the model, this field must be checked as a combined item.

The four default fields mid is the model ID, classid is the column ID, tempid is the template tag ID used in the list, ph is the combination item, and the ph parameter must be equal to 1, indicating that the combination item is used, otherwise it cannot filter.

Recommended to study "Empire cms tutorial"

The specific code is as follows:

The code is as follows:

<form method="get" action="[!--news.url--]e/action/ListInfo.php">
<input value="11" type="hidden" name="mid">
<input value="" type="hidden" name="classid">
<input value="1" type="hidden" name="ph">
<input value="2" type="hidden" name="tempid">
<div>
<p>价格从:<input id="minprice" type="text" onKeyUp="gprice.value=minprice.value+&#39;__&#39;+maxprice.value">至
<input id="maxprice" type="text" onKeyUp="gprice.value=minprice.value+&#39;__&#39;+maxprice.value"></p>
</div>
<input id="gprice" type="hidden" name="gprice">
<div>
<input type="submit" value="提交">
</div>
</form>
Copy after login

Other similar range interval queries The function can also be implemented with reference to this example.

The above is the detailed content of One trick to solve the method of filtering the price range by custom fields in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!