Skip Navigation

[Resolved] Relation Many-to-Many and "multi" chaining

This support ticket is created 6 years, 10 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 10 replies, has 2 voices.

Last updated by thibautF 6 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#605189

Hello,

I have a fairly complex problem.
I'm trying to track a sports competition.
My data is organized as follows:

League -> Cup -> Qualification -> Pool phase one -> pool phase 2 -> Final

I wish I could then display the information by going up the chain, or down.

What do you recommend ?
What to set up to view the information in frontend?

Thank you for your support

#605323

Dear Thibaut,

I assume we are talking about this case:
Custom post types "League", "Cup", "Qualification" ...
One "League" post can connect to multiple "Cup" posts,
One "Cup" post can connect to multiple "Qualification" posts
...

If it is, I suggest you try to setup "League" as parent post type of "Cup",
setup "Cup" as parent post type of "Qualification"
...
https://toolset.com/documentation/user-guides/creating-post-type-relationships/
Then you will be able to query the child posts in a single parent post:
https://toolset.com/documentation/user-guides/display-fields-table-content-using-views-or-the-types-api/
And display parent post information in a single child post:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

#605529

I read all i can and tell you if i need help

#605612

OK, please update this thread if you need more assistance.

#605659

Hello,

I come back to you because I can not do it. I can not understand the logic of filters ...
Despite all my reading and testing, I do not understand how it works.
My level of English does not help me either I think ...
I miss a vision of things ...

I have a parent-child channel as described above and I would like to be able, by selecting for example the league 2017 to display the cups of that year, as well as the progress of these cuts ...
The only thing I can display, without really understanding how, is to display the complete list of leagues, or the complete list of cups ...
Having created a many-to-many relationship, I will have to be able to extract the participants for each event ...

Could you guide me or show me an example that would serve me as a basis ...
With all my excuses to make you "repeat" what is written in your guides ....

#605667

To avoid more misunderstandings, please confirm this first:


I assume we are talking about this case:
There are some custom post types in your website:
- "League",
- "Cup",
- "Qualification"
...
One "League" post can connect to multiple "Cup" posts,
One "Cup" post can connect to multiple "Qualification" posts
...

Can you confirm above?

If it is, I suggest you try to setup post type "League" as parent post type of "Cup",
setup post type "Cup" as parent post type of "Qualification"

is there any problem to the parent/child relationship?
https://toolset.com/documentation/user-guides/creating-post-type-relationships/

#605679

You did understand the structure. I understand quite well the parent-child relationship principle.

An example :
In 2017, there was 1 league in this competition. This league featured 3 cups in the year. Each cup has been composed of qualifications, hens and finals ...

Regarding the structure created in the backoffice:
League is cutting parent. Cup is he even qualifications parent etc.

I actually read and follow all your guides on cpt in many-to-many relationship

#605698

For parent/child relationship:
One "League" post can connect to multiple "Cup" posts,
One "Cup" post can connect to only one "League" post,
Then setup "League" as parent post type of "Cup"
https://toolset.com/documentation/user-guides/creating-post-type-relationships/

For many-to-many relationship:
One "League" post can connect to multiple "Cup" posts,
One "Cup" post can connect to multiple "League" posts
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/

So you will need to choose one of above options according to your website settings.

And there are some document about:
Implementing many-to-many relationships
https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-many-to-many-relationships/
Implementing one-to-many relationships
https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-one-to-many-relationships/

For your reference.

#605708

The league / cup / etc relationship is a simple parent / child relationship.

I use the many-to-many relationship by adding a separate "registration" cpt for each cpt above. This cpt "unscript" allows me to link several drivers to several events, as in your example with the artists in your guide.

For the moment, my problem is in the display of children and parents in the simple parent / child relationship but chained (ie a child, will also be the parent of the element below).

On the second sheet of the document sheet of google doc, you can see the created structure: hidden link

#606136

For the question:

For the moment, my problem is in the display of children and parents in the simple parent / child relationship but chained (ie a child, will also be the parent of the element below)

Yes, you can display will be able to query the child posts in a single parent post:
https://toolset.com/documentation/user-guides/display-fields-table-content-using-views-or-the-types-api/
And display parent post information in a single child post:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

If you still need assistance for it, please provide a test site with same problem, and fill below private detail box with login details, also point out the problem page URL, I can setup a demo for you.

#606208

Thx