Problem: A post type called sweaters has a field called color_code that contains an alphanumeric code like "BL6". A second post type called colors contains an alphanumeric field color_code and a second field color_name with the value "blue". How can I say "when the sweater post type field 'color_code' value matches the color post type field value 'color_code', display the color post type field 'color_name'"?
Solution:
- Create a View of Colors, filtered by the custom field "color_code", where the value is supplied by a shortcode attribute "color_code"
- In the Loop Output of this View, insert a Types field shortcode that displays the value of the "color_name" custom field.
- Insert the View of Colors in the Content Template or Layout used for Sweaters. Insert a Types field shortcode to supply the value of the color_code shortcode attribute, like this:
[wpv-view name='your-view-slug' color_code='[types field="color_code" output="raw"]']
Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 1 reply, has 2 voices.
Last updated by 6 years, 8 months ago.
Assisted by: Christian Cox.