I found another way that seems to be more clear
You can create a reaction category (parent) - has many - category (children)
That way you can create a category like Fashion
Another one like Male with parent Fashion
when you see the Fashion category will note that the field children will point to the Male and in Male category you will see Fashion as parent, you can also do it to Male, creating t-shirts with male parent, and so on…
opened 02:10PM - 23 May 20 UTC
closed 09:12PM - 24 Mar 22 UTC
issue: feature request
severity: low
- [x] **I have created my request on the Product Board before I submitted this i… ssue**
- [x] **I have looked at all the other requests on the Product Board before I submitted this issue**
Hello everyone!
It would be really interesting to easily manage hierarchical content.
Currently, with the "**has many**" relationship, you can easily set up a parent/child link between two entries of the same collection, here is an example for a page collection :

An item can have one parent, and several children. This can be useful when you want to set up a page tree system for example, it allows to manage urls thanks to the hierarchy.
But it would be much more convenient, if it was possible to look and manage these relationships directly from the list view of the collection. For example, the WordPress [Nested Pages](https://fr.wordpress.org/plugins/wp-nested-pages/) extension, offers an interface and drag & drop for this :

Come to think of it, on Strapi's side, it might look something like this :
<img width="1689" alt="sort" src="https://user-images.githubusercontent.com/56544866/82732425-6d2ca700-9d0d-11ea-87b0-1661ca96341d.png">
Parent/child relationships could be managed by drag & drop, as well as the order of entries (linked with this feature request : https://github.com/strapi/strapi/issues/3946). We could also fold the groups of entries.
To do this, one could imagine that additional options would be available to make a collection hierarchical and sortable. This could create implicit fields: parent / children / order, which would be updated when dragging & dropping.

This offers several possibilities at the API level: retrieving children of an element, retrieving an element according to its parent etc...
It also gives the possibility to generate fields thanks to the hierarchy, here is a basic example :
```javascript
// page.js
module.exports = {
beforeSave: async (model, attrs, options) => {
let fullSlug = "";
// here we update the field "full_slug", by concatenating the parent's one
if (model.relations && model.relations.parent) {
const parent = model.relations.parent;
const parentSlug = parent.attributes && parent.attributes.full_slug;
fullSlug = `${parentSlug}/${attrs.slug}`;
} else {
fullSlug = attrs.slug;
}
if (options.method === "insert") {
model.set("full_slug", fullSlug);
} else if (options.method === "update") {
attrs.full_slug = fullSlug;
}
},
};
```
the most common case, would obviously be the management of page trees, but also, for example, the hierarchy of documents, a list of employees, etc.