Skocz do zawartości

Rekomendowane odpowiedzi

Opublikowano

This hook allows you to customize how you want a filter to work on text and textarea fields inside of IP.Content. You may not know this, but IP.Content hard codes the specific comparison made for each filter inside of the code. Date filters, for example, always provide results that are AFTER the date you put in. For all of the text and textarea fields, your results are a simple substring search.

This hook fixes a small bug inside of IP.Content 2.1.1 and older that treats all numeric columns as text as well. So if you have a field called 'price' and want to filter all the values that equal 2 you would get all records whose price contains the number 2. So you may see things like '20.00', '3.29', and '45.02' in your results.

Directions - In your filter box, if you choose a text field it will now allow you to provide a hint as to the comparison method. The possible comparisons are:

> greater than

< less than

>= greater than or equal to

<= less than or equal to

= equal to

! not equal to

Filter (note that whether the field is numeric or non-numeric will be recognized appropriately):

[price (numeric)] filter: [> 20] // Filters records with a price greater than 20

[price (numeric)] filter: [< 30] // Filters records with a price less than 30

Effective Result:

Returns records with a price between 20 and 30 (non inclusive)

Filter:

filter: [=red]

Effective Result:

Only returns records that match the string 'red' exactly

Filter:

filter: [!red]

Effective Result:

Returns records that aren't the string 'red'

Filter:

filter: [red]

Effective Result:

Performs a substring search for the string 'red'

Pobierz plik

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.