Skip Navigation

[Resolved] Many-to-Many Relationship not working as expected/needed

This support ticket is created 5 years, 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Last updated by Lee 5 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1314147

Lee

I'm creating a festival website. A performer will perform multiple times during the festival. There are multiple "stage" locations that they might perform.

I have a CPT "Location" for the different stage locations.
I have a CPT "Performers" for the different Performers.

I created a Many-to-Many Relationship between those two with intermediary fields, "Start Time" and "End Time" to note the times when the performer would be performing.

When I edit the Performer and add that they will perform on the Main Stage at 2pm, the record is added. But when I attempt to add a new record that they will be performing again on the Main Stage at 6pm. The Location "Main Stage" isn't available as an choice.

How can I properly associate/link the Performer to the Location. When they'll perform at the Location multiple times?

Thanks, Lee

#1314185

Hello,

It is expected result, in Toolset Many-to-many relationship, you can connect the same two posts only once.
So it conducts the result:
But when I attempt to add a new record that they will be performing again on the Main Stage at 6pm. The Location "Main Stage" isn't available as an choice.

You might consider below workaround, for example:
1) Create three custom post types:
- Location
- Performers
- Performance(with custom date fields: "Start Time" and "End Time")

2) Setup two post type relationships:
one-to-many relationship between Location and Performance
one-to-many relationship between Performers and Performance

So you will be able to create multiple "Performance" posts and connect it with the same "Location" + "Performers" posts.

#1314679

Lee

My issue is resolved now. Thank you!