Skip Navigation

[Resolved] Adding post relationships

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by Minesh 1 month, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2787114

Apparently, someone resolved my last ticket without my permission. So here it is again.

I have two post types: Tours and Volunteers
On the Tours post type, I have a repeating field for Volunteer Shifts that includes the fields Start Time, Duration, Position. This is so I can add the available shifts to the Tour.
I connected Tours and Volunteers in a Many to Many relationship using those Volunteer Shift fields
I thought what would happen is that when I add a Volunteer to a Tour that it would let me choose from a dropdown of the available Volunteer Shifts for the Tour. Is that possible? Otherwise, I'm typing them in and possibly misspelling so they don't match up. The Volunteer Shifts are a repeating field because they may be different for each Tour.

Is there any documentation that you are following?

I followed the documentation for setting up a Many to Many relationship.

What is the link to your site? hidden link

#2787437

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I have two post types: Tours and Volunteers
On the Tours post type, I have a repeating field for Volunteer Shifts that includes the fields Start Time, Duration, Position. This is so I can add the available shifts to the Tour.
====>
ok.

I connected Tours and Volunteers in a Many to Many relationship using those Volunteer Shift fields
===>
I see you are using same fields that you added to your repeating field group to your many-to-many post relationship.

I thought what would happen is that when I add a Volunteer to a Tour that it would let me choose from a dropdown of the available Volunteer Shifts for the Tour. Is that possible? Otherwise, I'm typing them in and possibly misspelling so they don't match up. The Volunteer Shifts are a repeating field because they may be different for each Tour.
===>
No you can not use those fields inside many to many post relationship.

When you create a repeating field group, internally its managed as one to many post relationship. Where parent is the post where you added the repeating field items and child is repeting field group items itself.

Here is the Doc that shows information how you can create and display repeating field group:
=> https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/

What if you configure the "Volunteer shift duration (in hours)" and "Volenteer Position" fields as drop-down select field and add all required options for those fields for your many to many post-relationship fields:
=> hidden link

Then when you go to connect the post using many-to-many relationship you will have dropdown select options. Will that help?

#2788460

The main problem is that the volunteer positions are unique to each tour. So I don't need to include every iteration for every tour. The dropdowns would end up being really long. I will have to play around with it.

#2788475

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - then there is no other solution I shave to offer you at the moment.