I don’t know if this is possible with the current DB schema, but here goes. I have main categories, these are simply marked with a boolean value in the DB. Then there is a comma-delimited list of subcategories.
For example:
MainCat1
SubCat1
SubCat2
SubCat2-1
Subcat3
So in MainCat1’s subcategory field there would simply be “SubCat1” and in SubCat1’s subcategory field there would be “SubCat2, SubCat2-1” and so forth.
I hope that makes sense! I don’t mind how you show it, they will eventually be nested lists.
DB Schema:
id |maincat | subcats |
---+---------+--------------------------+
MainCat1 | 1 |SubCat1 |
SubCat1 | 0 |SubCat2, SubCat2-1 |
SubCat2 | 0 | |
SubCat2-1 | 0 |SubCat3 |
SubCat3 | 0 | |
You can create sublevels:
You can use arraykeys to set the sublevel: