Skip Navigation

[Resolved] Multiple relationships

This support ticket is created 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by louE 5 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1321199

hidden link
Tell us what you are trying to do?
Hello, I have a View showing Articles and I need to show multiple related Authors for each Article. I am not using the default WP Authors, but have a custom post type "Staff". Some articles have more than one "Staff" writer and would like to show both on those particular articles. I'm having difficulty with the concept of creating a nested View of Authors, filtered by post relationship, where the parent post is set by the current post in the loop.

I have tried following the directions in a previous ticket, but ran into serious issues when I tried to switch my current one-to-many "Staff to Articles" relationship to a "many-to-many" relationship. I've done a lot of work so far, and this seems to throw me back to square one.

I'd really be appreciative if someone could take a look.

#1321445

Hi, I'll be glad to take a look if you provide login credentials here for me. Let me know exactly where I should look on the front-end of the site to see the View of Articles. Thank you!

#1321571

A single wpv-post-title tag won't work to display multiple posts. So back to square one, I would create a new many-to-many relationship between Staff and Articles. I would not try to repurpose an existing relationship.

Then I would add some connections between the revolution of 1948 article and some existing Staff members. After that, I would create a View of Staff filtered by this new post relationship, where the related Article is set by the post where this View is shown. In the loop, just output the post title for now. I don't see the need to nest this View in another View, it should just be inserted in the Article template.

#1321601

The problem with this solution is that there are many, many more articles with multiple staff authors.
I'll have to go in and manually make those connections (which is what I'm trying to avoid) :-\
The site was Drupal to WordPress migration and the relationships were created during the migration process.

And it looks like there's no way to use [wpv-conditional] on a field that is outside of the current view.

This is a conundrum for me.

#1321641

You can import new post relationships using a CSV file if you'd like to avoid making manual post connections in wp-admin. This works without re-importing all the post content that already exists. It's the most efficient way I can think of short of using a custom SQL script.
https://toolset.com/documentation/user-guides/importing-content-from-csv-with-post-relationships/
The WP All Import Pro plugin can import post relationship information as custom field values, then the Toolset import tool can convert those into post relationships.

As far as using wpv-conditional with fields outside the current View, it should be possible, depending on a few criteria. I would need more information about what post is displayed in the View, which post contains the field you want to use in the conditional, how they are related, which field you want to display, and so on. For example, if you know the post's ID, you can use the "item" attribute in a Types field or Views shortcode:

[types field='some-field-slug' item='12345' output='raw'][/types] or [wpv-post-slug item='12345']
#1323093

Closing ticket now. Thanks for the info.