Home › Toolset Professional Support › [Resolved] Hide container if custom field is empty
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.
This topic is split from https://toolset.com/forums/topic/editable-form-on-home-page-or-content-template-as-home-front-page/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9: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/Karachi (GMT+05:00)
Related documentation:
This topic contains 4 replies, has 2 voices.
Last updated by Waqar 4 years, 6 months ago.
Assisted by: Waqar.
I have a section called, "Hobbies" and the section has 3 columns w/3 container blocks that the client can fill out for 3 hobbies
BUT, the client only has 2 hobbies and doesn't fill out the last custom field (on a form) for the 3rd hobby.
SO, I don't want that last column or container to show on the section on the front-end.
Would I use conditional shortcodes to manage this or is there a better solution? Perhaps you can point me in the right direction.
Thank you. Could def use some help on this one.
Hi,
Thank you for contacting us and I'd be happy to assist.
To suggest the best way to achieve this, I'll need to see exactly how these fields and container blocks are set up in the admin area.
Can you please share the temporary admin login details, along with the link to the example page where these blocks can be seen?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Also, I tried to use a Conditional Block and set it to :
Post Data
Current page
the custom field ("Virtual Me About")
Field ("hobbies")
and then set to "Empty"
Does this setup mean that IF the field ("Hobbies") is empty, (that the client didn't write anything in this box), it won't show?
and if the client DID write a hobby in this field it will show? (this is what I'm trying to get it to do)
Because right now it's not showing no matter what.
Thank you for sharing these details.
I couldn't find any conditional block in the "Virtual Me Template" content template, but to show repeating items like hobbies in a grid layout, you can follow these steps:
1. Instead of using a multiple lines type "Hobbies" field, you can add a repeating field group in your post type "Virtual Me":
https://toolset.com/lesson-placement/lesson-placements-1621067-1624449/#creating-repeatable-field-groups
In that field group, you can include single-line type custom field "Hobby Name". This will allow you to add multiple hobbies with each "Virtual Me" post.
2. After that, in your "Virtual Me Template", you can include "View" to show these new hobby repeating field group entries, in a grid layout through a "Single Field" block:
https://toolset.com/lesson-placement/lesson-placements-1621067-1624449/#displaying-repeatable-field-groups
I hope this helps and please let me know if you need any further assistance around this.