Skip Navigation

[Resolved] Structure setup of website that displays courses

This support ticket is created 6 years, 6 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#950069

I want to make a page that will display all available courses with with the ability to filter on city, location, startdate / month, and a taxonomy filter on grouptype, after the course is chosen, a single page will be shown with the specific course details and the possibility to download a brochure, a signup form for the course and a few other things.

A single course can have multiple startdates and times, can be held in different cities and locations and can also have different teachers.

What is the best way to connect it all together? Do i have to make different custom post types and use relationships? Or use taxonomies for cities, location and teachers?
For the custom post titel I want to use the unique name of a course so that i can link to it.

I need some help with the setup of the basestructure, so that everything is connected to the course in the right way.

A website example that does practicly the same thing: hidden link

Can somebody steer me in the right direction?

The website is still under construction, not a live website.

Many thanks!

#950257

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Using taxonomies for cities, locations, and teachers is problematic if you just have a post type for the course, because if you have a course for "Bee-keeping", well, you can't sometimes assign the Stockholm term to it and sometimes the Helsinki term to it, etc...

I would set this up with a one-2-many relationship, where the 'one' (the parent) is a course, and the 'many' (the children) are instances or occurrences of the course.

So you would have a bee-keeping course post that contains lots of details of the course generally, such as the material that will be covered, course requirements etc., and then for every occurrence of the course you would create a child post, e.g. for "Bee-keeping in Stockholm on July 28", "Bee-keeping in Helsinki on July 28", "Bee-keeping in Stockholm on August 15" etc.

These child posts are where you attach data that is specific to that particular occurrence of the course, e.g. the location, the price, the teachers etc.

As a general rule it is better to use taxonomies for things you want to filter by (e.g. a city field, because people will want to choose their city to see local courses from the whole list), and custom fields for information that just needs displaying (e.g. price, maybe teacher, because they are probably not searching by the teacher, although if you wanted to include a teacher profile you might want to create a teacher post type and set up a M2M relationship between teachers and course occurrences).

I think that should set you off on the right path, but if you are unsure about something, please ask.

#950375

Thanks for your answer Nigel

Okay, your explanation makes sense to me.

So if i'm correct i use
- the City as a taxonomy and assign it to the childpost.
- For the 4 different basegroups i assign the taxonomy only to the parent or also to the child post?
- The location could be a normal one line field cause of the many different locations available.
- The teacher field a select field, no need to filter on, if in the future our client wants to include a teacher profile i will make it a M2M.

#951332

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That sounds right, although I'm not sure what basegroup is.

You should assign the taxonomy to either the parent course or the child course occurrence, depending on which makes sense.

Is the basegroup the same for all occurrences of a course? Then assign the taxonomy to the parent course.

If the basegroup varies depending on the occurrence of the course, then assign the taxonomy to the child.

Except. You can only filter something by properties of that thing. So if you need to filter course occurrences by basegroup, then the taxonomy needs to be assigned to child course occurrences.

A future update will allow you to filter by fields of related posts (e.g. show course occurrences for whom the parent course belongs to basegroup alpha), but that is not currently possible.