I am struggeling with "beforesearch" (code pack) on al list & search type to set a value before search. But I did not found any hint or help on seblod.com. I tried to add code on the "hidden" part on the search form, but now result so far.
What I want to achieve:
I want to filter a list of articles with two dates. The articles are about "events" of our club. Some events have an start and end date, some only a start date. Events with a start date in the past should be filtered out, expect if the there is an end date which lies in the future. Therefore I want to use the value of the end date for the search filter instead of the start date. End date is 0000-00-00 00:00:00 eg. empty when not used.
I tried to add a beforesearch field with the following code:
I put the code below in a beforsesearch field in the "Hidden" position in the "Search Form" view. Also the two fields with the start date and end date from the articles. I created a new JFrom Calendar field with none storage in the "Main" position called "event_date_search".
For me, it is not clear where to put the fields, the beforesearch and the one I want to change (in my case "event_date_search")? Is it in the view "Search Form"? Or in the "List"? Do I have to replace the ['search'] option with something else?
A short step by step explanation would be helpful. I am sure "beforesearch" is extremely useful.