I have post type that has a post relationship with another post type. It's essentially like an order-detail set up where I have an order post type with a relationship to multiple order-detail post types. For example, the order post type has the name and date of the order and the order detail is the individual items in the order. I need to be able to display this information in a list.
Right now, I can build a view that shows the orders but I don't know how to show the related order detail records along with them. I have this:
Order 1, Joe Blow
Order2, Mark Smith
...
And I need this:
Order1, Jow Blow,
blue car
red car
Order2, Mark Smish
blue car
green car
Can you help me with configuring a view to do that?
Hello. Thank you for contacting the Toolset support.
Well - you need to use nested view's structure. You need to filter your view with the relationship.
Please try to follow steps:
- Create a new view that display Order Details
- Add a post-relationship filter from "Query Filter" section.
-- click on the button "Add a filter"
-- Select "Post relationship or repeatable field group owner" and click on the button "Add query filter"
-- Select your relationship and option "current post in the loop", add things you want to display to loop editor section of this view and save the filter and view
- Edit the view which displays the "order", navigate to "loop editor" section of this view and add the view you created above that displays the order details, save the view
- Create a page and add the view that displays order and you will see the order and associated order details will be displayed
Update: I think I fixed this. Let me continue and I'll update the ticket shortly.
Thanks for the reply. I was a little confused by your explanation but the link to the page helped clear things up. However, when I try to view the results, the page load times out for taking more than 30 seconds. I have about 3,000 "orders" so I wonder if that is an issue. I tried limiting the results to just 2 but it still timed out. Do you have any suggestions for that?