I have created a Views and wants to offer the ability for the users to find posts related to a specific date thanks to a parametric search.
For that, I have tried to add a filter to my Views but did not find the postdate parameter there.
Is there a solution for that?
Hello. Thank you for contacting the Toolset support.
Well - its not possible to add the front-end filter for post date but you can allowed to add the "Query Filter" for post date but not the front-end filter.
If you want to set up front-end filter for post date field then I the only possibility is you should create a custom field that will hold the post date field value (that means you need to find a way to copy the post date field value to this custom date field) and then add this custom field as a frontend filter.
I have seen that I can define a date filter (in the upper section of the Views) and I have tested it. That's working and I have used the url parameter to define the right date. Now, I have 2 issues :
1. In this section, you can define the date only by splitting it (year, month, date ...). I would prefer to be able to define the define in one shot !
2. If I understand well, I need to define a form in which I place some parameters and then construct the url with all needed parameters value to redirect to the page where the Views is?
What's your recommandation on this : do I need to use a hook (cred_success_redirect) for that or do you have any other simpler solution?
1. In this section, you can define the date only by splitting it (year, month, date ...). I would prefer to be able to define the define in one shot !
==> Where you want to define this? as there is no such feature available.
2. If I understand well, I need to define a form in which I place some parameters and then construct the url with all needed parameters value to redirect to the page where the Views is?
=> Sorry, this is different question and I do not understand how it's related to the date filter question?
The initial request was to be able to add a parametric search based on the post date to a Views.
Your answer was that was not available in the standard Toolset Views.
So, I'm searching the best way to offer the ability for my users to chose a date (or an in between date) to adjust the result of the Views in the front end.
Something like :
Your date : (a datepicker to select the post date)
Submit
And then, the list of posts with the specific post date.
Something like :
Your date : (a datepicker to select the post date)
Submit
==> How this form you will configure - using Toolset forms? if yes, create form or edit form? In addition to that datepicker will pass the value as timestamp so you need to find a way to convert timestamp to date and set as URL param. You may use the hook cred_success_redirect hook to add/configure your desired URL param and redirect the page on which you have added your view with date filter.