creating multiple collection is not practical. since you will have to create new collection for every level
the deeper nested you go, the more collection you will have…
i prefer to have 1 collection only:
- Create collection “Category”
- Add relational field called “parent”. this field is “many-to-one relation” with the same “Category” collection. (it will read as “Category has many Categories” in strapi)
now when you enter the data:
enter “Desserts” and leave the parent field blank
Enter “Cookies” and choose “Deserts” from the Parent field drop down
To get your data in the api, you should populate the parent field
and that’s it …now u can add as many levels as you want.
Note: if you want the same sub-category falls under different categories (for example category Diet under Food and under Sweets) then choose many-to-many relation