Tell us what you are trying to do?
I have a post type - "Referrals", and a Post Type "Attorneys". Within Attorney's Custom Fields, I have an RFG "Attorney Communication Settings". I also have a View where I show all Referrals in a Tabular Format. I would like to show the a field from the Attorney Communication Settings , e.g. Fax Number in this View where I show Referrals. What is the best way to do that. I tried the tutorials for displaying RFG, but that seems to be focused on showing a Detailed Page where a single Post is being shown. I have a View that is showing a list of Posts (Referrals) and want to show the RFG that is of another Post Type Attorney which has a one-many relationship with Referral. I can't find any other documentation on such method. Let me know if my explanation needs further clarification.
Is there any documentation that you are following?
No, But I am thinking I would use a [types field='...'][/types] short code or types render field API using a special Item Attribute or something similar to try to achieve this.
Is there a similar example that we can see?
What is the link to your site?
Hello,
How do you setup the post type relationship between "Referrals" and "Attorneys"?
One-to-many between "Referrals" and "Attorneys"?
Or One-to-many between "Attorneys" and "Referrals"
I assume it is:
One-to-many between "Referrals" and "Attorneys"
And in a WordPress page, you are going to setup a post view to display "Referrals" posts list, each "Referrals" item display related "Attorneys" posts informations.
If it is, it require nested views. For example:
1) Grand parent post view:
- Query "Referrals" posts,
- In view's loop, display below parent post view
2) Parent post view:
- Query "Attorneys" posts
- Filter by post type relationship between "Referrals" and "Attorneys"
- In view's loop, display below child post view
3) Child post view:
- Query RFG "Attorney Communication Settings" posts
- Filter by post type relationship filter: RFG "Attorney Communication Settings"
- In view's loop, display custom fields of RFG "Attorney Communication Settings"
More help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
My issue is resolved now. Thank you!