Home >CMS Tutorial >Empire CMS >How to combine item list attribute filtering in Empire CMS

How to combine item list attribute filtering in Empire CMS

王林
王林Original
2019-11-07 13:57:353707browse

How to combine item list attribute filtering in Empire CMS

This article takes the rental column list filtering as an example.

1. Create fields

You can see that 4 fields are used to filter the rental column list: "Area", "Rent", "Room", "Method" ".

1. The value of the field "region" is: "Quan'anshan", "Tiedong", "Tiexi", "Lishan", "Qianshan", "Others", the field settings are as follows:

How to combine item list attribute filtering in Empire CMS

2. The values ​​of the field "Rent" are: "No limit", "Below 500 yuan", "500-1000 yuan", "1000-1500 yuan", " 1500-2000 yuan", "2000-3000 yuan", "3000-4500 yuan", "more than 4500 yuan", the field settings are as follows:

How to combine item list attribute filtering in Empire CMS

#3, field " The values ​​of "hall" are: "no limit", "one room", "two rooms", "three rooms", "four rooms", "more than four rooms", the field settings are as follows:

How to combine item list attribute filtering in Empire CMS

4. The value of the field "Method" is: "Full rental", "Single room rental", "Bed". The field settings are as follows:

How to combine item list attribute filtering in Empire CMS

2. Install and modify the plug-in

Download the Empire cms official combined item list attribute filter plug-in, then open the "fieldand.txt" file and copy all the contents in the file to /e/class /userfun.php file (place it anywhere between); (It is recommended to use editing tools such as Dreamweaver or Editplus to modify)

First, in the list of combined fields to be displayed, change "$fieldandvar= 'myarea,sex,age';" change to "$fieldandvar='quyu,zujin,tingshi,fangshi';", this is the list of 4 fields we need to display.

Then we use 4 colors to represent the area of ​​each field code, so as to intuitively analyze their common code points, as shown below:

How to combine item list attribute filtering in Empire CMS

From the above picture Get the field and field display separator "$fieldexp=' |".

Then analyze according to the format: "Option Description |==|Content 1, Value 1 ## Content 2, Value 2":

How to combine item list attribute filtering in Empire CMS

Finally get Modified value:

How to combine item list attribute filtering in Empire CMS

Get the selected option link style according to the code "Quananshan" "$changefieldandcss='select'; ".

According to the above figure, the display spacer format of the combination of options and options: start display character|end display character gets "$valexp='';".

The modified plug-in code is shown in the figure:

How to combine item list attribute filtering in Empire CMS

Notes:

1. The code is correct, but The reason why the filtering does not work is that the combination of the corresponding fields of the system model is not checked.

2. When filtering, the prompt "The connection you came from does not exist" is because "&classid=column ID" is not specified in the address bar.

Recommended tutorial: Empire CMS Tutorial

The above is the detailed content of How to combine item list attribute filtering in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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