I am trying to make the visibility of a form conditional by the date (custom field) of the parent post.
Using the conditional system itself is great but i may write the code wrong.
So far i have tried it many ways and i came up with this so far:
[cred_show_group if="( $(event-date.parent) gte TODAY() )" mode="fade-slide"]
The "event-date" is a date from the parent custom post.
So far it has not worked, i think i need to write it differently.
I spend a day on this but can't find a solution. Sorry can you help me?
Hello. Thank you for contacting the Toolset support.
Well - there is no way to compare the parent field with [cred_show_group ] shortcode as its not supported natively but if you agree I can take it as a new feature request.
So, there is no way to make a conditional display of a form that is comparing the TODAY() condition to a custom Date field on the page it is displayed?
I want to achieve that this "Event submission Form" is automatically not available after the "Date of the Event" has passed. It will spare me and my coworkers a lot of time.
If i may ask you, do you have any idea how to achieve this without the direct comparison to the parent page?
For example, I already have a parent relationship in the form by using "@RELATIONSHIP-SLUG.parent " that helped my automatically create a relationship with the page the form is displayed. (Thanks to annother supporter from toolset) In the same manner, can the custom Date field not be seen and compared for a conditional display?
If it is not possible in any way, yes it would be great if a request could be made. Thank you for your time.
I want to achieve that this "Event submission Form" is automatically not available after the "Date of the Event" has passed. It will spare me and my coworkers a lot of time.
==> Well - for that you should use a content template where you should add [wpv-conditional] shortcode and add your conditional check. I would like to know here is "Date of the Event" field is created using Types?
Can you share problem URL where you added the form?
I have set the next reply to private which means only you and I have access to it.
Well - I didnt knew that you were using Elementor.
What if you try to use following code to check your event post date conditionally within your form:
[wpv-conditional if="( '[types field='datum-des-events' output='raw'][/types]' lte 'TODAY()' )" debug="true"]
the event date is less than or equal to Today.
[/wpv-conditional]
Please feel free to change condition as per your requirement. Currently its set to less than or equal to.
But at the moment I can't do anything. Every time I go into the form I want to change a message comes up and says that the "toolset support" (Your user handle) has taken over and is in the process to edit.
I don't know if this is a bug or if it is still you in there trying things.