Skip Navigation

[Resolved] Displaying a post relationship in a View

This support ticket is created 6 years, 6 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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by josephQ 6 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#918570
02-query-filter.png
01-content-selection.png

Tell us what you are trying to do? I've got two post types: an Author (parent) and a Work (child). Many Works may belong to one Author. I would like to display a grid of Works, with a thumbnail image from the Work post type and a First Name and Last Name from the Author post type. I've tried to configure the Query Filter (see attached for settings) but have not been successful. The page that displays this View just reports "No items found" (see web address below). Can someone take a look and tell me what I'm doing wrong? I'm basically looking for a gridded listing of...

[Work.Thumbnail]
[Auther.First_name] [Auther.Last_name]

Is there any documentation that you are following?
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

Is there a similar example that we can see?
No.

What is the link to your site?
hidden link

#918638

Hello,

I assume you are going to display a list of Author posts, in each row of author post, display the related Work posts.

It needs a nested view, your screenshots is the child view. For example:
1) Parent view list all Author posts, in the "Loop Editor" section, display below child
2)In the child view, you can use the same setting of your screenshots:
hidden link
and
hidden link

#918836

Luo,

Thanks for your reply.

You wrote: I assume you are going to display a list of Author posts, in each row of author post, display the related Work posts.

This is the opposite of what I'm trying to accomplish: I want to display a list of Works, and for each Work I want to display some Author information.

Does this make sense? Do I still need to use a nested view?

#919112

Thanks for the explanation, in your case, it does not need a nested view, you don't need to the relationship filter, see it in your screenshot:
hidden link

So you can query all "Student Work" posts, and in the Views loop, display the related Author information, see our document:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/
Using Post Reference Field To Display Data Of Related Posts

#919135
Screen Shot 2018-06-29 at 01.44.30.png

Luo,

Thanks for your response, I appreciate it. You're suggesting that I need to create another field, a post reference field, to connect the Student Work to the Author. The problem to me with this approach is that there's already a field to connect the posts—the post relationship itself (see screenshot: the image is of the connection to an Author (Student Designer) on a Student Work page). I would have to connect all of the posts *twice* using two different methods. This doesn't seem right to me. Does it seem right to you?

#919144

Nevermind! Feel free to close this ticket. I was able to access the parent post without a query filter and use the @relationship.parent syntax.

Thanks, Luo!