Skip Navigation

[Resolved] Multiple relationships within one post type

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#523744

I have a question regarding Many-to-Many postrelationships.

I want to create catalogue of people with relationships.
So, each person could have multiple persons as parents and multiple persons as childs. As in real life. For example:

Person 1 has Father - Person 2, and Mother - Person 3. In the same moment Person 1 has children - Person 4 as Son and Person 5 as Daughter.
So, then I try to create this kind of database structure, I find that there is no possibility to create some intermediate post (e.g. PersonInRelationship) type with one Post Type (e.g. Person) both as child and parent.

So, could you help me to solve this case in some most efficient way?

#523882

I would create a Post Type (Persons) and add as example Person One.

Descendants of this person is a Child Post Type to the Person (Children of the person)
And another Post type, parent of Person, is used to connect Father, Mother, Grandparent or so of that person.

So in the end you have this structure:
- Parents or other
-- Person
--- Children

To connect many Persons to a Children you can setup a post type "relationship" that is child to both of them.
This then allows you to connect several Children to Several (also same) parent.
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/

The same can be done between Person and Parents.

The forum ‘Types Community Support’ is closed to new topics and replies.