Skip Navigation

[Resolved] Conditional fields if else problem

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 3 voices.

Last updated by Minesh 4 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2763165

Hi guys!

In one of my views I have two conditions to make if else to display the post update date.
Unfortunately this doesn't work.

In the "wlasna-data" field I have entered a text string (this is a textarea field for my own date if needed), and yet the date from the second condition is displayed: [wp_last_modified id="19"]

I must be missing something, please help.
Tomasz

[wpv-conditional if="( $(wpcf-wlasna-data) ne '' )"]
[types field='wlasna-data' item='19' output='raw'][/types]
[/wpv-conditional]

[wpv-conditional if="( empty($(wpcf-wlasna-data)))"]
[wp_last_modified id="19"]
[/wpv-conditional]

#2763176

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

That is strange. Can you please share admin access details and let me check what's going wrong with the setup.

Please share problem URL where I can see the conditionals you added.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2763493

Christopher Amirian
Supporter

Languages: English (English )

Hi,

This is Christopher. I'm here to inform you that Minesh will not be available today. He will answer the question tomorrow.

I tested the login information and it works ok. So Minesh will have the necessary information to continue the investigation tomorrow.

I appreciate your patience.

#2763499

Thanks for the info!
I'm waiting patiently 🙂

#2769995

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I checked the view you shared:
- hidden link

I see you added the conditional shortcode outside the loop's output:

[wpv-conditional if="( $(wpcf-widok-tabel-dla-internauty) eq '2' )"]...[/wpv-conditional]

If you want to check for the custom field value with conditional shortcode outside the view's loop, you will have to use it as follows:

[wpv-conditional if="( '[types field='widok-tabel-dla-internauty'  item='19' output='raw'][/types]' eq '2' )"]...[/wpv-conditional]

As you can see with the Types shortcode - we are using the item attribute where are are passing the item ID 19 from which the custom field value is fetched from.

[types field='widok-tabel-dla-internauty'  item='19' output='raw'][/types]

I can see those dots on homepage: hidden link

#2770004

Oh gosh, I didn't know that 🙂

Thanks a lot for your help!

best regards
Tomasz