Prefilter by date but keep using the filters for List

mirceat

Member
Hello,

I know that i can add a prefilter condition to filter all the records from latest 6 months for a specific view level:

Code:
where:
field = contracts_tool___date_time
condition: greather than
value: DATE_SUB(NOW(), INTERVAL 6 MONTH)
type=no quotes

But I also need to allow for this view level to search for records older than 6 months if they want. The "contracts_tool___date_time" element have Filter type set to Range, but because of prefilter it only shows records from last 6 months...how can i pass this restriction when the element is used for filtering in List view?

Thank you
 
You'll need a SystemLinks/URL menu item. As far as I can remember the "Query string" setting in the Fabrik List menu is doing only for simple filtering like &foo=bar.

An other possibility (e.g. if the "full" view is usually not needed):
2 list menu items, one with the prefilter, one without
 
And to make it even more user friendly, you can link to the "all" menu item in your list's intro, so you would have a link something like "Show all" or "Show older records" in list heading.

An other possibility (e.g. if the "full" view is usually not needed):
2 list menu items, one with the prefilter, one without
 
Well, I tried with the following code (the menu was changed from Fabrik to System Links/URL):

index.php?option=com_fabrik&view=list&listid=259&contracts_tool___date_time[value][]=-6 month&contracts_tool___date_time[value][]=now&contracts_tool___date_time[condition]=BETWEEN

But i cannot get the latest 6 months, instead the range is between 22/04/2022 and today
 
As far as I can see the dates are showing correctly in fabrikdebug and it's filtering the correct records but the range filter is showing nonsense.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top