This is a theoretical site... but i want to ask if it's possible first
I have a CPT named pipes. Some pipes have multiple diameters, so I use a repeating field group to list them for each pipe. (for example one particular pipe has these diameters: 5, 7, and 9)
on each singular content template for pipes, I want to display a view of all the clamps that will fit the pipe. (in this example i want to display all clamps that are of diameter 5, 7, or 9)
is this possible? if it is not possible without code, is it possible using https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts to find the diameters of the repeating field group, and then use that information to filter the toolset view such that it will display the correct clamps?
Hello,
I think it is possible without custom codes.
For example, you can try these:
1) In post type "clamps", setup a custom field "clamps-diameters"
2) Edit each "clamps" post, setup value in field "clamps-diameters"
3) In single "pipe" post, display nested view:
Parent post view,
- query related pipe repeating field group posts
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/
- In view's loop, you can get each item's "diameters" field value, pass this value as below child post view shortcode attribute
4) Child post view
- Query "clamps" posts
- Filter by field "clamps-diameters" equal to view shortcode attribute value, see our document:
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes
https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/