I'm trying to subscribe Students to certain Workshops that are given at a number of Locations. What I need to know is what Workshop a Student has chosen per Location.
For the Student I have created a Repeatable Group with two Single line fields: Workshop Location and Workshop Name.
I understand that I cannot create new RGF's while adding the Student. So this is what I have come up with for a scenario:
1. Student fills in name and emailaddress;
2. Student clicks Submit to send the form to the server;
3. The server adds the Student and adds as many Workshop Locations to the Student as there are Locations;
4. Then the Student is given an overview of his subscription with a list of all Locations;
5. Each Location has an Edit button next to it, so the Student can fill in the blanks.
Would this work in ToolSet or is there a better way?
The only problem I see in the usage is that the Student might not finish choosing all Locations.
Technically, I would need some help with setting up the Student Template with the View and Edit buttons, but I suppose this documentation would help: https://toolset.com/course-lesson/front-end-forms-for-editing-content/?#adding-an-edit-link-to-a-list-of-items
Hello,
For the scenario you mentioned above 1 ~3, it can be done with Toolset plugins, please elaborate more details for 4 and 5:
4. Then the Student is given an overview of his subscription with a list of all Locations;
5. Each Location has an Edit button next to it, so the Student can fill in the blanks.
How do you setup "all Locations"? are you using a custom post type for "Locations"?
Are you going to let students to edit "Locations" posts?
Hi Luo Yang,
Locations are created by an admin. Location is a CPT. No, Students cannot edit the CPT Locations; the Students will edit the Repeatable Field called Workshop Location in their own Student type.
Thanks for your help!
Thanks for the details, in your case, there does not exists any Repeatable Field item.
And it needs many-to-many relationship, for example, you can try these:
1) Setup many-to-many relationship between "Student" and "Locations"
2) In the overview page, display a post view, query all "Locations"
3) In view's loop, display a relationship form for user to connect "Student" and "Locations" posts:
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/
And then add a field to the Student-Location relation to store the chosen Workshop?
Okay, I will try later this week and let you know how it goes.
I have marked this thread as "Waiting for feedback" status, please update here if you still need assistance for it, thanks
As I'm setting up the new relation, my eye caught something you wrote earlier. I wrote:
"3. The server adds the Student and adds as many Workshop Locations to the Student as there are Locations;"
And you replied:
"For the scenario you mentioned above 1 ~3, it can be done with Toolset plugins [...]"
I was under the impression that I would have to write a php function to add these Workshop Locations. Could you please tell me how I would add these relations with ToolSet pluging?
You wrote:
1) Setup many-to-many relationship between "Student" and "Locations"
2) In the overview page, display a post view, query all "Locations"
3) In view's loop, display a relationship form for user to connect "Student" and "Locations" posts:
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/
In 2) you write about making a view, but in the documentation it says create a Relationship Form. I'm confused. Which is it or is one in the other?
Thanks for your help!
Yes, the document is for step 3): In view's loop, display a relationship form for user to connect "Student" and "Locations" posts.
Since my suggestion is using many-to-many relationship, it needs to use relationship form to connect the "Student" and "Locations" posts.
For your reference.
Ah, now I see how to connect two types with a Relationship Form. So I can now make my question a bit more specific:
As I wrote earlier:
1. Student fills in name and emailaddress;
2. Student clicks Submit to send the form to the server;
3. The server adds the Student and adds as many Workshop Locations to the Student as there are Locations;
4. Then the Student is given an overview of his subscription with a list of all Locations;
5. Each Location has an Edit button next to it, so the Student can fill in the blanks.
In step two the relation between Student and Location has already been made. I need a form where both Student and Location are already known (as I am on the page about the Student and the connected Locations are shown with a View), but the Relationship field (Workshop to attend at that Location) still has to be determined.
Maybe it is easier for you to log in to my site and have a look as Shane has done before?
(Oh, and also: please have a look at my question of April 22, 2022 at 10:14 am, #2346835)
For the step 3) The server adds the Student and adds as many Workshop Locations to the Student as there are Locations;
Toolset won't connect posts automatically, in this step, you can setup a post view:
- query all Locations posts,
- in view's loop, display the relationship for user to connect his foveate "Locations" post
See my above answer:
https://toolset.com/forums/topic/add-new-type-form-with-rgf/#post-2341045
If you still need assistance for it, please provide a test site with the same problem, I can setup a demo in it.
I understand your answer, but it's not what I want.
Every Students needs to select a Workshop per Location. The Student does not choose a (favourite) Location.
I can give you a login to my site for you to check out. It's still in development, so you can treat it as a demo site.