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

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

silencement
silencementforward
2019-11-28 13:46:512440browse

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>

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!

Statement:
This article is reproduced at:www.word666.com. If there is any infringement, please contact admin@php.cn delete