I have two post types Fellows and Committees, with a many-to-many relationship between them. I create a content template with post type Committee which lists some committee specific fields as well as a loop over committee fellows through the relationship. The template works in the editor by using the committee selection drop-down menu at the top and using "preview". I then added a page in WordPress with a toolset View with data source Committees. In the loop of this view, I added the content template from earlier. I want a listing for all committees with a sub-listing of all fellows in each committee. When I preview the result, I see a listing of committees, including correct data from the template for Committee fields, but the fellows listing within the content template shows "No Items found". Can you please advise on how to fix the issue?
Is there any documentation that you are following?
I used the standard Toolset docs.
Is there a similar example that we can see?
I am not sure.
What is the link to your site?
The page with the issue is at: hidden link
Attached are two screenshots from the editor: the content template with a listing of committee fellows, and the page listing all committees with all fellows associated with each committee (the issue page).
Thank you for contacting us and I'd be happy to assist.
From what you've shared, I suspect that for the view that shows the related "Fellow" posts (which is inside the single "Committee" content template), the relationship query filter is set to the option "The post where this View is shown".
( example screenshot: hidden link )
To make the content template work from another view, you'll need to change that query filter option to "The current post in the loop", instead.
I hope this helps and please let me know how it goes.
Thanks for the prompt response. I'm afraid your suggestion did not resolve the issue. Please see attached screenshot. The page now lists no committees. Any other suggestions?
During troubleshooting, I managed to make it work, by adding the following changes:
1. From the view "Committee Listing" included on the page "Committees", I removed the query filter from the content selection.
( screenshot: hidden link )
This is because this page needs to show all "Committees".
2. In the content template "Committee Template", there is another view "Committee - Membership & Nominations".
In this view's content selection, I changed it to show all fellow posts, and then included a query filter to show only those posts (fellows) that are related to the current post (committee) in the loop.
( screenshot: hidden link )
After this change, the same view is showing the related fellows correctly on the single "Committees" pages as well as in the view used on the "Committees" page.
I hope this makes it more clear and let me know if you have any follow-up questions.