Hello
I need help on how to organize the data in WordPress to make a database of movies as follows:
The main CPT will be Movies.
Each movie will be assigned the following data: Year - Director - Country - Genre
With this information I want to show listings of movies by Country - By Director - By Genre - By Year
Whenever I show the list of movies I want them to be grouped by year.
For example, the structure of a movie listings by country would look like this:
COUNTRY: USA
2017
List of 2017 USA movies
2016
List of 2016 USA movies
2015 ....
At the same time I want to be able to filter that listing by genre (or/and director) through some filters in the sidebar, so I can show something like this:
COUNTRY: USA +FILTER Genre: Comedy
2017
List of 2017 USA COMEDY movies
2016
List of 2016 USA COMEDY movies
2015 ....
If I select a particular year to see only the movies of that year the list will change:
YEAR: 2017
List of 2017 movies
But if I want to filter more, I still want to be able to do:
YEAR: 2017 +FILTER Genre: Comedy +FILTER Director: Steven
List of 2017 COMEDY movies By STEVEN
I will add more fields like COMPANY - LANGUAGE... to each movie to be able to filter the listings as in the previous examples.
My main question is how do I organize all this within WordPress?
Apart from the CTP Movies the rest of the information like: YEAR - COUNTRY - DIRECTOR - COMPANY - GENDER - LANGUAGE should they all be CTPs?
The data of the YEAR is very important because all the listings are grouped by year.
For now what I would need is guidance on how to start organizing this structure within WordPress.
Thanks!
Daniel
I would go with one Post Type (Movies) and classify the rest with either Fields or Taxonomies.
There are several approaches, some of which we also document:
https://toolset.com/documentation/customizing-sites-using-php/displaying-repeating-fields-one-kind/
https://toolset.com/2015/07/how-to-group-posts-by-category/
https://toolset.com/2015/06/8-ways-to-improve-the-user-experience-of-your-wordpress-admin/ > Tip 3: Organize your data details using custom fields
https://toolset.com/2015/04/how-to-create-a-news-site-using-wordpress-if-you-are-not-a-php-developer/
The Year can be a taxonomy or Field, both allow you to query by them in the front end of a post view.
Also, you can sort primarily by both.
Thanks Beda!
I'm attaching some pictures to visualize what I need.
In the pictures, the list shows the DIRECTOR category and then filters are applied. But the same thing should be done by showing the category COUNTRY + filters, GENRE + filters... etc.
In the case of using taxonomies, I think I will face the problem of how to sort the results when more than 1 taxonomy is involved.
Can I get the results as in the pictures using only the MOVIES CTP and taxonomies for the rest of fields?
The Date is a Field.
The Movie a Custom Post Type.
The rest are taxonomies.
You can then:
- create an archive for movies and add Custom Searches by Taxonomies and Fields.
- You can order the results as primary order by your Custom Date Field as well.
- create the same kind of posts (movies) list on a Posts View, which you can place anywhere on your website.
You can add Custom Filters by each thing (taxonomy, field) once per View or Archive.
This should cover all you need, as far I understand it.
Thank you Beda!
I think this is a good starting point for the design of the project.