I'm currently working on a side project for a friend who runs a training program. I'm trying to intergrate his workshops into Silverstripe so he can easily update them, and I can do some funky stuff on the website to display them (planning to intergrate google maps - fingers crossed).
This is the relationships I have.
They have Workshops.
Each Workshop has many Dates.
Each Date has one Location and many Instructors.
(Locations and Instructors belong to many Dates)
How would I achieve this in the CMS? I have gone through tutorial 5, and can understand how to relate Dates to Workshops, and add a tab to add/edit/remove dates, but how do I then select/add/edit/remove a Location and Instructors to each Date?
The hard thing here is you cannot nest complextablefields. So I you will have trouble managing Instructors as its on 2 branches of a has many.
I think one way you could do it is like:
- Workshop is a page
- Dates is a HasManyComplexTableField on that page
- Inside the Date Popup you have a CheckboxSetField of all the Instructors (which you can then select many) and a dropdown for the location.
Then you would just need to generate a way of adding / editing instructors and locations. The easy way to do this would be to just add a TableListField to the WorkshopPage which allows you to manage them. Its a bit nasty.
Or you could try using ModelAdmin to manage the data - In that case you would have 2 managed models - Instructions, Locations and you would keep the HasManyComplexTableField().