Skip Navigation

[Résolu] Split: MMA Database Design with the help of Toolset

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 6 années et 6 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 6 années et 6 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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:
lien caché

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:
lien caché
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:
lien caché

<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