


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+'__'+maxprice.value">至 <input id="maxprice" type="text" onKeyUp="gprice.value=minprice.value+'__'+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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment
