D
D
Dmitry Solomatin2020-06-28 19:21:56
WordPress
Dmitry Solomatin, 2020-06-28 19:21:56

How to properly organize the structure of custom posts and taxonomies?

Good afternoon.
I am migrating a large regional portal with infrastructure objects to WordPress. Need an opinion from a storage design professional.

There are categories of objects:

  • Nutrition
  • Accommodation
  • Attractions
  • ...

There are 10 categories in total, I'm going to make each category as a separate type of custom post.

Each category of objects has its own set of filters:
  • Nutrition
    • Type of establishment: cafe, restaurant, canteen
    • Services: Wi-Fi, Payment by card
    • ...

  • Accommodation
    • Type: Hotel, Guest house
    • Line: 1-line, 2-line
    • ...

  • Attractions
    • Type: Parks, Museums
    • ...

  • ...
    • ...


Each category has its own set of filters, up to 10 properties, I'm going to make them in the form of custom taxonomies, each property is a separate taxonomy. Taxonomies are tied to a specific post type.

Each object, regardless of category and set of filters, is tied to a specific city. The city is essentially the same filter property. I suppose to perform in the form of one taxonomy tied to all custom post types. Cities are hierarchical, main city -> satellites, but this can be omitted from the discussion.

The result of filtering within any category is a list of objects that match the selected properties and the city (or all cities).

Requirement:
Each category in City A, City B, ... and on the "All cities" page should allow editing text + title + meta;
Each category with a city selected or not selected, with any set of filter properties, should allow editing text + title + meta;

Tasks:
  1. Food (All cities) - there is no place where you can specify text + title + meta in the structure I proposed;
  2. Catering (All cities + Cafe) - you can specify the text + title + meta in editing the "Cafe" term;
  3. Meals (All cities + Cafes + WiFi) - there is no place where you can specify text + title + meta in the structure I proposed;
  4. Food (City A) - there is no place where you can specify the text + title + meta in the structure I proposed;
  5. Food (City A + Cafe) - there is no place where you can specify text + title + meta in the structure I proposed;
  6. Food (City A + Cafe + WiFi) - there is no place where you can specify text + title + meta in the structure I proposed;


The solution that seems to me the most optimal at the moment:
1. Create a custom page type "SEO_category" for each category (namely, page, so that you can then use the hierarchy for order).
2. Attach those taxonomies that are used in a particular category.
3. In the "Cities" taxonomy, create the "All cities" term.
4. Create pages by putting down the necessary terms. In order not to get confused in the sets, for the first property of the filter, make parent pages and add child pages to them.
With this approach, you do not have to drive the client into editing term descriptions, and he will always be able to use Gutenberg.

Am I using WP features correctly? And what do you think of such a structure?

What the structure looks like now, on a self-written CMS of a liquidated web studio:
Nothing unusual, you can not get acquainted

Все города [папка]
- Питание (текст + title + meta) [запись]
- Проживание (текст + title + meta) [запись]
- Достопримечательности (текст + title + meta) [запись]

Объекты [папка]
- Город А [папка]
- - Питание (в редактировании папки указывается текст + title + meta)[папка]
- - - Объект 1 [запись]
- - - Объект 2 [запись]
- - Проживание [папка]
- - - ... [запись]
- - Достопримечательности [папка]
- - - ... [запись]
- Город Б
- - Питание (в редактировании папки указывается текст + title + meta)[папка]
- - - Объект 1 [запись]
- - - Объект 2 [запись]
- - Проживание [папка]
- - - ... [запись]
- - Достопримечательности [папка]
- - - ... [запись]

Фильтры [папка]
- Питание [папка]
- - Вид заведения [папка]
- - - Ресторан [запись]
- - - Кафе [запись]
- - - Столовая [запись]
- Проживание [папка]
- - ... [папка]
- - - ... [запись]
- Достопримечательности [папка]
- - ... [папка]
- - - ... [запись]

Тексты для наборов фильтров [папка]
- ... (указывается ссылка с get параметрами фильтра и вносятся текст + title + meta) [запись]

На уровне "Все города" решается: Питание (все города)
На уровне "Объекты" решается: Питание (Город А)
На уровне "Тексты для наборов фильтров" решается: Питание (все города + Кафе + WiFi) и Питание (Город Б + Кафе + WiFi)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question