Skip Navigation

[Resolved] Split: MMA Database Design with the help of Toolset

This thread is resolved. Here is a description of the problem and solution.

Problem:

Many-to-many relationship between post types "fighters" and "fight",

I have 2 fighters - Max and Andre. How can I show Max's Title when I look at Andre's profile?

What settings do I need to make this work?

P.S. Max and André - 2 fighters in a single fight

Solution:

It needs a nested view, for example,
1) parent view get related "fight" posts of current "fighter" post,

filter by:
Select posts in a Fights Fighters relationship that are related to the Post where this View is shown.

And display below child view:

2) Child view get related "fighter" post exclude current "fight" post:

in section "Query Options", enable option "Don't include current page in query result"

filter by:
Select posts in a Fights Fighters relationship that are a related to the current post in the loop.

3) Put the parent view into a single "fighter" post:

<hr />
<h2>Show related fighter's Title</h2>
[wpv-view name="related-fights-of-current-fighter-parent-view"]

Please test it, check if it is what you want. thanks

Relevant Documentation:

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 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#905285

Max

OK. I have 2 fighters - Max and Andre. How can I show Max's Title when I look at Andre's profile?
What settings do I need to make this work?
P.S. Max and André - 2 fighters in a single fight

#905291

Hello,

It needs a nested view, for example,
1) parent view get related "fight" posts of current "fighter" post, see it in your website:
hidden link

filter by:
Select posts in a Fights Fighters relationship that are related to the Post where this View is shown.

And display below child view:

2) Child view get related "fighter" post exclude current "fight" post:
hidden link
in section "Query Options", enable option "Don't include current page in query result"

filter by:
Select posts in a Fights Fighters relationship that are a related to the current post in the loop.

3) Put the parent view into a single "fighter" post:
hidden link

<hr />
<h2>Show related fighter's Title</h2>
[wpv-view name="related-fights-of-current-fighter-parent-view"]

Please test it, check if it is what you want. thanks

#905376

Max

Yes, exactly what I wanted. Thank you

#905955

You are welcome