Skip Navigation

[Resolved] Getting the query filter to work

This support ticket is created 5 years, 1 month 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 1 reply, has 2 voices.

Last updated by Waqar 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1406077

Hi there!

I'm getting confused on how to set the right filter for the view I'm trying to create. I would like to display testimonials from a specific trainer on an event page. The problem I'm facing right now is how to automatically fill up the testimonial view, with testimonials from the trainer that is organizing the event.

I created a proxy post type for the trainers, that has a one to many relationship with the CPT for events, and with the CPT for testimonials. On the trainers page, the relationships make sure that only the events and testimonials from the trainer are displayed (example: hidden link). However, I don't know how to display the testimonials from the trainer, on the event page itself(example event page: hidden link). It seems like I can only show all the testimonials, or I have to create a view with testimonials, for a specific trainer. This isn't going to work when there are a lot of trainers, that need to be able to create their own events. The name of the view is: Testimonial.

Can you please tell me how to achieve this?

Your help is much appreciated!

Greetings,

Kerim

#1406599

Hi Kerim,

Thank you for contacting us and I'd be happy to assist.

For what you're planning on the event pages, you'll need two views:

1. The first parent view will be set to show all trainer posts, which are related to the current event.

2. A child view will be placed inside the first parent view's loop, to show testimonial posts related to the current trainer post in the loop.

The view "Testimonials-roos" that you're using on the events page can be used as a child view (point 2), but the Query Filter option for the relationship will need to be changed to "The current post in the loop".
( screenshot: hidden link )

Here is a useful guide on the topic of nested views:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/#adding-a-view-to-a-view

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar