Skip Navigation

[Resolved] Forms: Generic field select filled by view

This support ticket is created 2 years, 8 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
- 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 8 replies, has 3 voices.

Last updated by Minesh 2 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2317255

I want to be able to select from a list of possible Workshops when adding a Student.

The student gets a link to fill in his name and emailaddress. The Workshops he can choose from are based on the school he attends and to which scheme his school is assigned. Each scheme has one or more locations, and each location has one or more workshops.

In a diagram:
School -> Scheme -> Location -> Workshops

I can show the Workshops on any page with a view (although I only see three whereas I have added four Locations), but I would like to have the Workshops as a list of which the Student can only choose one.

I have found the generic field "select" to be able to accept a shortcode as input. How does this work? Is there any documentattion about it?

I can set up an admin account for you to have a look.

thanks, Michiel

#2317303

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Yes, please, let me review your structure first.

Can you please share problem URL where you want to allow the student to select the workshop form the dropdown list?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2317367

Minesh
Supporter

Languages: English (English )

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

So, what if you create a One-to-Many post relationship between Workshop and Student . So, when you interact with student form, the related workshop will be presented. So, that One workshop can have many students.

Will that work?

#2318119

Maybe. At least I have a place to store which Workshops the Students want to attend. But I need the Students to choose from a list of Workshops per Location. And I don't see a possibility to filter on Location.

My guess is that I need a View to show all Locations (for the given Scheme) and each Workshop of the Location as a selection for the Student to choose. The form would look something like this:

Name: ______
Email: _______
Location1
( ) Workshop A
( ) Workshop B
Location 2
( ) Workshop F
( ) Workshop K
Location 3
( ) Workshop Y
( ) Workshop Z

Number of locations and workshops is variable.

#2318127
Screenshot 2022-03-16 at 09.18.17.png
Screenshot 2022-03-16 at 09.17.45.png

Btw, can you also have a look why I only see three Locations on the front end while on the back end I see four?

hidden link

#2318191

Minesh
Supporter

Languages: English (English )

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

Btw, can you also have a look why I only see three Locations on the front end while on the back end I see four?
hidden link
==>
The issue was the following post that was not displaying was not published.
- hidden link

I published the post and I can see now it does displays the four related posts.
- hidden link

Regarding the following:
https://toolset.com/forums/topic/forms-generic-field-select-filled-by-view/#post-2318119
==>
I see you created post relationship "Workshops Leerlingen" between workshop (parent) and student (child). There is no way to display workshop filter by location. Even as its One-to-many post relationship, on the following page:
- hidden link

We can only assign one parent workshop, we can not assign multiple workshops.

#2319701

Ah, thanks for solving that issue with the 4th Location not showing.

It was your idea to create the Workshop - Student relationship, not mine. So back to the main question: how can I show Workshops per Location as a selection?

#2321007

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

HI Michiel,

As Minesh is away I will be handling this ticket for him.

Based on what I read, you require some form of dependent dropdown when creating the post, for e.g if you want to create Student A and student A selects Location B, you want only the workshops in location B to be available to the student and not every other workshop.

If that is the case then this won't be possible without some form of custom coding to create the dependent dropdown.

There are other ways using the conditional conditional tags and purely custom fields. However this will require some setup and you would've needed to enter all the datasets.

Let's say you have 5 different locations. This will mean that you will need to create 5 different dropdowns for your workshop where each workshop dropdown will be directly dependent on the 5 different locations.

So if the user selects location A only the dropdown for workshops related to location A will be shown.

Thanks,
Shane

#2322679

Minesh
Supporter

Languages: English (English )

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

I hope Shane answered your question. Please let me know if you need further assistance other than the current issue. If yes, please open a new ticket with every new question you may have.