Skip Navigation

[Resolved] Limit of intermediary post

This support ticket is created 2 years, 11 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 2 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2263731

Actual we work with two Custom Post Types in many to many relationship
1.) Lehrgänge (english courses)
2.) Referenten (english Speakers)
The intermediary Post Type Thema (english Theme) has some custom fields.

Over these Relation we Create in an Lehrgang / course a list of different Themes a Referent / speaker presents
hidden link

But now we have the problem that a speaker should add a second theme.
But if i will connect in the Lehrgang again these speaker, it get the following error while saving:
"There was a problem creating the related content: These two elements are already associated and the relationship doesn't allow non-distinct associations"
It seems that we have the many to many relationship for speakers and courses, but the intermediary Post Type Theme was the limit.

Is there a way to add more then one intermediary Post Type Theme with the same speaker to the same course?

#2264317

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct, multiple relationship connections between the same two posts are not supported and you can't have more than one intermediary post for connection between those two posts.

Can you please share some information about the custom fields that you need to store with each Thema intermediary post? I'll be in a better position to share some workaround, accordingly.

regards,
Waqar

#2264319

Hi Waqar,

we have the following custom fields in intermediary post
Reihenfolge (Order) = to show the different speaker themes in a defined order
Vortragstitel (Title of Theme)
Vortragsinhalt (Short Description of Theme)
Wochentag (Day)
Dauer (Duration- an input field, because we have sometimes a defined time and sometimes only hours)
Bemerkung (Comment - an input field, f.e. for time of break)

#2265315

Thank you for sharing these details.

To achieve something similar, I can think of two workarounds, that you can use:

a). Instead of using multiple custom fields in the intermediary post type, you can include only one single line type custom field and set it to have multiple instances.

In each instance/record of that custom field, you can enter all the information items, in a single line in a specific format, something like:
{Order}. {Title of Theme} - {Short Description of Theme} - {Day} {Duration} ({Comment})

Example:
1. This is the title - This is a short description - Monday 2 p.m. - 6 p.m. (Coffee break 4:00 p.m. - 4:15 p.m.)

For another theme entry, you can add another instance in this same custom field.

OR

b). This one is a little more complex. Instead of joining courses and speakers post types directly through a many-to-many relationship, you can connect them using a third post type "Theme".

Custom post types:
- Courses
- Speakers
- Themes

Note: the custom fields that you currently have with the intermediary post type, will be attached to this new "Themes" post type.

Relationships:
- Courses -> Themes: One-to-many relationship, so that one course can be connected to many themes, but one theme can only connect to one course.
- Speakers -> Themes: One-to-many relationship, so that one speaker can be connected to many themes, but one theme can only connect to one speaker.

Whenever, you'll need to enter a new theme record, you'll add a new post in the "Themes" post type and select which "Course" and "Speaker" this record belongs to.

I hope this helps and please let me know if you need any further assistance around this.