Filtering integer with custom condition.

More
5 years 4 months ago #76956 by MatGod
I have a category view with a filter. This filter is a dropdown with 1,2,3,4,...

If I select 2, all items with the value 2 are gonna show. But I would need to show every item with the selected value and any value lower.

If I select 1, all items with the value 1 are shown.
If I select 2, all items with the values 2 or 1 are shown,
If I select 3, all items with the values 3 or 2 or 1 are shown.
etc.

What would be the best way to achieve this?

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #76957 by micker
hello did you check filtering tab for this field .. maube you can use sql custom request ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #76964 by MatGod
I tried using the custom SQL, but it only affects the dropdown.

I have an idea but I'm not sure how to execute it.

If we take this as an example
Code:
SELECT value, value as text FROM #__flexicontent_fields_item_relations WHERE field_id='{field->id}' AND value != '' GROUP BY value

I can return a custom value, can this value be an array with all the values I want.

It would kinda be like faking multiple checkboxes.

If I select 1, I return the same thing as when someone checks 1 in a checkbox. (filter_16[]=1)
If I select 2, I return the same thing as when someone checks 1 and 2 in a checkbox. (filter_16[]=1&filter_16[]=2)

If this is possible, I'm not sure which format to use when returning the value from my query.

Please Log in or Create an account to join the conversation.

More
5 years 4 months ago #76965 by ggppdk
Hello

1 reason for no such possibility of custom condition on filtering the result query with custom condition,
is because we wanted to avoid abuse that will then claim that flexicontent is "slow"

> If I select 1, I return the same thing as when someone checks 1 in a checkbox. (filter_16[]=1)
> If I select 2, I return the same thing as when someone checks 1 and 2 in a checkbox. (filter_16[]=1&filter_16[]=2)

and then it would be ??
If I select 3, I return the same thing as when someone checks 1 and 2 and 3 in a checkbox. (filter_16[]=1&filter_16[]=2&filter_16[]=3)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.331 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline