Looking for some assistance determining which views/fields/queries I need to create to do the following.
I want to create a layout for a CPT for Suspensions. In the layout I want to show some data from related CPTs and their related CPTs.
Suspensions have a relationship to Access Cards. From here I have figured out how to get the Access Card # which is the title of the Access Card CPT.
Access cards have a relationship to Homeowners. From here I have figured out how to the Homeowners name which is the title if the Homeowner CPT.
Homeowners have a relationship to Properties. What I can’t figure out is how to display the title of the Property CPT associated with the Suspension/Access Card/Homeowner being displayed.
Hello,
I assume we are talking about this case:
Four post types:
- Suspensions
- Access Cards, a post type relationship with "Suspensions"
- Homeowners, a post type relationship with "Access Cards"
- Properties, a post type relationship with "Homeowners"
If it is, I suggest you try to setup four level nested view, see our document:
Displaying Fields of Grandparents
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/
Lou thank you! I'm getting close. I can now display the record (Suspension CPT), parent-record (Access Card CPT), and grand-parent-record (Homeowner CPT). I'm having problem displaying the great-grand-parent-record (Property CPT). I'm able to query and get a great-grand-parent record just not the related one.
In your screenshot:
hidden link
section "Query Filter", there should be a post type relationship filter(between post types "Homeowners" and "Properties"), see our document:
Displaying many related items
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
If you need assistance for it, please provide a test site with the same problem, I can setup a demo for you.
Thanks for the details, checking it in your website, will update here if there is anything found
I have done below modifications in your website:
1) Modify the post view "Access Cards with Suspensions Property Address":
hidden link
in section "Query Filter", change the filter from:
Select posts in a Properties Homeowners relationship that are a related to the post where this View is shown.
To:
Select posts in a Properties Homeowners relationship that are a related to the current post in the loop.
2) Edit the post view "access-card-user-name":
hidden link
in section "Loop item in Access Card User Name", display above views shortcode:
<hr />
Related properties
<hr />
[wpv-view name="access-cards-with-suspensions-property-address"]
Test it in front-end:
hidden link
I can see it works fine, please check if it is fixed, thanks
My issue is resolved now. You guys rock!! Thank you!