Home >CMS Tutorial >Empire CMS >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:
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:
#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:
4. The value of the field "Method" is: "Full rental", "Single room rental", "Bed". The field settings are as follows:
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:
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":
Finally get Modified value:
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:
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!