Skip Navigation

[Resolved] "if" conditional output at fields & text block not showing and not working anymo

This support ticket is created 2 years, 11 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)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Shane 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2069951
old-new.jpg
conditional-in-fields-and-text.png
output-start-end-datetime-by-conditional-output.jpg

Tell us what you are trying to do?
I outputted a start/end datetime depending on conditional output inside a fields and text block.

I made this to show the start/end datetime in a natural way
"18.03.2021-18.03.2021" -> "18.03.2021"
"17.03.2021-18.03.2021" -> "17.-18.03.2021"
"17.02.2021-18.03.2021" -> "17.02.-18.03.2021"
"18.03.2021.-18.03.2022" -> "18.03.2021-18.03.22"

see: output-start-end-datetime-by-conditional-output.jpg

It worked fine with Block 1.4.1 and Types 3.4.7. But after updating to Blocks 1.5.2 Types 3.4.10 it just don't works anymore.

The if conditional output disapeared

My conditional output for the start/end datetime was:

<div class="rd-info"><div><h4 class="rd-title">[wpv-post-title]</h4></div><div>[types field='termin-start-datetime' style='text' format='d.'][/types][wpv-conditional if ="( '[types field='termin-start-datetime' style='text' format='m'][/types]' ne '[types field='termin-end-datetime' style='text' format='m'][/types]' )"][types field='termin-start-datetime' style='text' format='m.'][/types][/wpv-conditional][wpv-conditional if ="( '[types field='termin-start-datetime' style='text' format='Y'][/types]' ne '[types field='termin-end-datetime' style='text' format='Y'][/types]' )"][types field='termin-start-datetime' style='text' format='Y'][/types][/wpv-conditional][wpv-conditional if ="( '[types field='termin-start-datetime' style='text' format='d m Y'][/types]' ne '[types field='termin-end-datetime' style='text' format='d m Y'][/types]' )"]-[types field='termin-end-datetime' style='text' format='d.m.Y'][/types][/wpv-conditional][wpv-conditional if ="( '[types field='termin-start-datetime' style='text' format='d m Y'][/types]' eq '[types field='termin-end-datetime' style='text' format='d m Y'][/types]' )"][types field='termin-end-datetime' style='text' format='m.Y'][/types][/wpv-conditional]</div><div class="rd-ort">[wpv-conditional if=" NOT ( empty( $(wpcf-termine-ort-name)) ) " ][types field='termine-ort-name'][/types][/wpv-conditional][wpv-conditional if="  ( ( $(wpcf-termine-ort-name) ne '' ) AND ( $(wpcf-termine-ort-ort) ne '' ) ) " ], [/wpv-conditional][wpv-conditional if=" NOT ( empty( $(wpcf-termine-ort-ort)) ) " ][types field='termine-ort-ort'][/types][/wpv-conditional]</div></div>
#2070381

Shane
Supporter

Languages: English (English )

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

Hi Thorsten,

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 one for you ?

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

Please also send me a link to the page where I can see the conditionals on the frontend.

Thanks,
Shane

#2070457

I know that my coditions are not perfect. But I need a conditional output where I can check if day, month and year of start/end datetime are equal or NOT equal

#2070569

Shane
Supporter

Languages: English (English )

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

Hi Torsten,

Can you provide me with admin access to the site where it works so that I can have a comparison to look at?

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

Thanks,
Shane

#2072667

Shane
Supporter

Languages: English (English )

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

Hi Thorsten,

The problem seems to be coming from the Field and Texts block, however on a fresh site i'm not able to replicate the issue.

There is a workaround however, as you can add the contents in the fields and texts block to a classic editor block and this should cause the conditionals to start working again.

I'm currently checking on the installation where it works.

Thanks,
Shane

#2072669

Shane
Supporter

Languages: English (English )

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

I'm getting an unknown username error on the test site that you've sent.

#2072747

User should work now.

#2072771
Bildschirmfoto 2021-05-31 um 19.49.26.png

"The problem seems to be coming from the Field and Texts block, however on a fresh site i'm not able to replicate the issue."
Does that mean that the "if" for conditional output shows on your installation?

This screenshot is from a fresh wordpress install with just Toolset on it. Toolset Blocks 1.5.3, Toolset Types 3.4.10. (Just updated Blocks from 1.5.2 to 1.5.3)

The "if" for the conditional output does not show.

#2072785

Shane
Supporter

Languages: English (English )

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

Screenshot 2021-05-31 at 1.05.30 PM.png

Hi Thorsten,

Yes that is correct, the if conditional works fine. What is happening on your site is that the date fields are being rendered into ASCII characters rather than the actual values of the field, see screenshot.

This is why it is not working. I'm still working through. What I will do is grab a copy of your test site, then update views on that test site to see if the issue occurs.

Thanks,
Shane

#2072803

Shane
Supporter

Languages: English (English )

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

Hi Thorsten,

I've escalated this ticket to our 2nd tier supporters for further checks to see what could be the cause of this issue here.

Once I get a response I will provide an update on this for you.

Thanks,
Shane

#2073327
if-dont-shows-anymore.jpg
if-in-old-toolbar.jpg

Hi Shane,

"Yes that is correct, the if conditional works fine"

Does the "if" button still appears in the block editor toolbar from a text & field block in your test installation?
Like I told you I made a fresh wp install with just blocks and types installed and the "if " button don't shows up.

#2073647

Shane
Supporter

Languages: English (English )

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

Hi Torsten,

Speaking with our 2nd tier supporters our Developers have removed the ability to add the conditionals inside the fields and text blocks due to issues that come up from the filters that process the data.

Currently the "if" buttons are disabled. In your case the workaround is to copy and paste your conditional text from the Fields and Text block into the classic block. From there the conditionals should now process fine.

I also saw that you have some custom css classes attached to the fields and text block, you may need to restyle this by adding the classic block into a container block and then add the classes to the container block.

Please let me know if this helps.
Thanks,
Shane

#2074439

Hi Shane,

I used an html block instead of the classic block, and yes that one works. Thx for that.

I hope that they'll bring back the functionality and the "if" button to the fields & text block, as I wouldn't know how to realise such features like the in the actual case using toolset blocks. Even you couldn't set up the condition I am using by the Conditional Output Editor directly, it was a great help to set up the basic construct of conditions and changing them manually to my special needs afterwards.

I read through the changelog trying to find the specific changes. Could you tell me in which Version this changes where made?

#2074935

Shane
Supporter

Languages: English (English )

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

Hi Torsten,

This was actually changed in version 1.5 of Blocks. Currently i'm unable to say when this issue will be resolved but for now you will need to continue using the Classic block.

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.