Skip Navigation

[Closed] Nested views that query relationship not post type

This support ticket is created 4 years, 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 4 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1727415

I have a post type 'C&R Monitor' for a publication that contains 'Analyses' (articles) by 'Authors'. The Analysis post type is a child of C&R Monitor and Authors are children of Analyses (n Analysis article can have multiple authors). I have a view that queries 'Analyses' posts that are children of a 'C&R Monitor' post, with a nested view to show authors of the Analysis post. So far so good, all works perfectly.

However, the Analyses must be displayed in the correct order. So I have used a numerical sort order field on the C&R Monitor-Analysis relationship to order the Analyses: https://toolset.com/forums/topic/ordering-posts-in-a-relationship-with-another-post/

I have then created a view that queries the Analyses based on the relationship, and uses the numerical sort order field to order the results. Now the problem comes in - if I have a nested view showing authors, the correct argument is not passed to that view, because the post in the loop is not the Analysis post, but the relationship between C&R Monitor and Analysis. In the primary view, for instance, the post titles are returned: [wpv-post-link item="@cr-monitor-analysis.child"]

Is there a way around this - in my primary view to pass the argument of which post is in the loop to the nested secondary view that shows the authors of the post based on that relationship?

#1727799

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I will require to review your current structure and after that I will be in better position to guide you in the right direction.

Can you please share problem URL and send me information about your expected output as a test case example for any single post.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] Nested views that query relationship not post type’ is closed to new replies.