Skip Navigation

[Resolved] Display Conditional Child View depending on Custtom Field Value of Parent View

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to display a different child view based on a custom field value.

Solution:

This seems like something that can be achieved by using our conditional shortcodes to check the custom field value.

Take a look at our documentation below on our conditional shortcode and let me know if it helps.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/

This support ticket is created 6 years, 4 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 2 replies, has 2 voices.

Last updated by peterS-14 6 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1098603

Tell us what you are trying to do?

Depending on the Value of a Custom Field in the Parent I want to display a different Child View.

Example: The parent has a Custom Field called event type with 2 possible values:

- Concerts
- Classes

If the value is Concerts it should show a child view that lists the musicians
If the Value is classes it should show a child view that lists the teachers

The main issue for me is that I use Elementor which allows me to select a view and I can easy add a child view, but I somehow got stuck about how I could set up the the condition to show the correct view corresponding to the value in the parent view.

Any hint is very welcome and appreciated 🙂

#1098711

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Thank you for contacting our support forum.

This seems like something that can be achieved by using our conditional shortcodes to check the custom field value.

Take a look at our documentation below on our conditional shortcode and let me know if it helps.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/

Thanks,
Shane

#1098829

Hi Shane

thanks for your reply and pointing me into the right direction. I think my main confusion was where to use the the short codes for the conditions in Elementor.

Erroneously I tried to use them in the shortcode- and html module in Elementor but I should have added them just into the text module - after that it worked like a charm.

Thanks again, Peter