# hierarchy

Source: https://zotonic.com/docs/2099/hierarchy

URI: https://zotonic.com/id/2099

Language: en



The category hierarchy tables have been replaced by *m\_hierarchy*. This model defines named hierarchies of resources (pages).

If the categories are changed then the system needs to update the *pivot\_category\_nr* field of all resources. With the introduction of *m\_hierarchy* this renumbering is much more efficient and will only affect a minimal number of resources.

The *m\_hierarchy* module is also used for the content- and user group hierarchies, as used by the new *mod\_acl\_user\_groups* module.

Available Model API Paths
-------------------------

| Method | Path pattern                  | Description                                                                      |
| ------ | ----------------------------- | -------------------------------------------------------------------------------- |
| `get`  | `/+name/tree/...`             | Return full hierarchy tree for hierarchy `+name`.                                |
| `get`  | `/+name/tree1/...`            | Return first-level hierarchy tree for hierarchy `+name`.                         |
| `get`  | `/+name/tree_flat/...`        | Return flat tree-ordered list for hierarchy `+name`.                             |
| `get`  | `/+name/menu/...`             | Return hierarchy `+name` formatted as a menu tree.                               |
| `get`  | `/+name/menu_ensured/...`     | Return menu hierarchy for `+name`, ensuring required parent nodes exist.         |
| `get`  | `/+name/+id/menu_ensured/...` | Return menu subtree for hierarchy `+name` rooted at `+id`, ensuring missing parents are created. |
| `get`  | `/+name/+id/menu/...`         | Return menu subtree for hierarchy `+name` rooted at resource `+id`.              |
| `get`  | `/+name/+id/tree/...`         | Return hierarchy subtree for `+name` rooted at resource `+id`.                   |
| `get`  | `/+name/+id/tree1/...`        | Return first-level subtree for hierarchy `+name` rooted at resource `+id`.       |
| `get`  | `/+name/+id/tree_flat/...`    | Return flat tree-ordered list for hierarchy `+name` subtree rooted at resource `+id`. |

`/+name` marks a variable path segment. A trailing `/...` means extra path segments are accepted for further lookups.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2099?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2099?language=en>)
