Skip Navigation

[Resolved] How to disable the section if there is no data?

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 6 replies, has 2 voices.

Last updated by Minesh 7 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2690836
Screenshot 2024-04-03 at 5.05.05 PM.png

Hi, I am facing a challenge that I am not so sure how to figure this out.

I would like not to show the icon or any other item if the data doesn't exist.

I uploaded a screenshot so that you can clearly understand what I am trying to achieve. There are two kinds of prices. If we don't have one of the prices, the page still has to show the dollar sign that was previously implemented on the price.

I am also planning to add more icons with different data but the icons have to be there even though there is no content for this section.

How can I overcome this challenge to avoid this issue happening?

I would be greatly appreciate if you could guide me through this.

#2690923

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Normally - Toolset offers conditional block and conditional statement that you might use to display content conditionally.

More info:
Conditional Block - https://toolset.com/2021/08/5-advanced-uses-of-toolsets-conditional-block-in-wordpress/
Conditional Shortcode - https://toolset.com/documentation/legacy-features/views-plugin/#conditional-output-in-views

Can you please try which suits your requirement and check if you able to resolve your issue.

#2691501

Hi Minesh, I couldn't complete it because I was trying to add a custom field.

I can create a custom field for the specific category but it doesn't show on the post form. I created a couple of test fields to test it. None of them were showing on the relevant post form section. Could you please take a look?

#2691562

Minesh
Supporter

Languages: English (English )

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

You should have clarify that first.

Do you have post custom field or term custom field? If you have term custom field then term custom field is not yet supported by Blocks but I'll try to offer you workaround if available but for that I will first have to review your structure and requirement.

Can you please share problem URL where you want to display content conditionally and based on what field and send me admin access details.

*** 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.

#2691994

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing access details.

Can you please share problem URL on what URL you want to display what conditional content?

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

#2692000

Hi Minesh, please check the custom field called "Field Group for Canada" and you will see a custom field created as "Pet friendly".

After creating the custom field, this field should have appeared on the custom forms section called "create housing post" to be included. So the custom fields created don't appear on the forms section that I can include. Thank you!

#2692025

Minesh
Supporter

Languages: English (English )

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

The thing is that the field you created with the custom field group "Field Group for Canada" this field group is set to display with the post type "Homestays":
- hidden link

Now the form you created "create housing post" is to add new post for type type "Housings":
- hidden link

Form can display the custom field is that assigned to the post type. So, in your case the custom field is assigned to the post type "Homestays", if you create the form for the post type "Homestays" you should be able to see the custom field "Pet friendly".

#2692119

Hi Minesh, I got confused by the field name and should have checked the type first. That happens when we work at the late night 🙂 Thanks again. I will check the conditional fields to solve the initial request.