Skip Navigation

[Resolved] Help with a conditional date field

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Shane 3 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#2351821
2338785-Error_en_Fecha_Oferta.jpg

We use a conditional rule in our view to show this date field plus a few plain text words, when the field has been filled on the item, and we show a different plain text words when the field has not been filled.

This is the code we are using in our view to do this:

[wpv-conditional if="( $(valida-hasta) gt '0' )"]
<span>Válida hasta</span>: [types field='valida-hasta' style='text' format='j, F g:i a'][/types]
[/wpv-conditional]

It works almost correctly: if the date field has been filled, the red code is shown on the view, and if it has not been filled, nothing is showing up.

However, the problem comes when you fill the date field and then delete it (setting it to blank). In those cases, the date value is not shown, but the span text is. To fix this, we have to remove the item and then add it again making sure the date field is never filled.

Is there any way we can show that span text only when there is a date filled at the moment?

We have also followed the steps for a previous ticket that got clossed because of time expiration, which told us to use the debug mode.

We have tried to add debug=’true’ to the conditional field in order to see any hint about why it isnt working, but nothing seems to show up.

We have also tried to enable compact and complete debug mode in Settings > Front-End content but got no feedback either. (No pop ups were blocked)

Thanks in advance.

#2352105

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sandra,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Please where applicable please provide me with a link to an example page where I can see the issue.

I've enabled the private fields for your next response.

Thanks,
Shane

#2357145

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sandra,

The issue should be resolved now.

I had to change you conditional to use this shortcode [types debug='true' field='valida-hasta' output='raw'][/types]

Rather than the default syntax for custom fields. Not sure why it was holding onto a value when the database table entry was empty.

However using the shortcode also helps.

Thanks,
Shane