Skip Navigation

[Resolved] Listing relationship data in a content template.

This support ticket is created 2 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by vatcheS 2 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2231911
content template.jpg
page with problem.jpg

Tell us what you are trying to do?

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).

Thanks, and best regards,
vatche

#2232063

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

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.

regards,
Waqar

#2233677
Screen Shot 2021-11-30 at 8.59.00 PM.jpg

Hi Waqar,

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?

Thanks, and best regards,
vatche

#2234189

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

Can you please share temporary admin login details, so that I can see how this view and the content template are set up?

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

#2235109

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

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.

#2235707

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.