# mod\_admin\_category

Source: https://zotonic.com/docs/1842/mod_admin_category

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

Language: en



::: {.note title="Note"}
This module requires the presence of <a href="/id/doc_module_mod_menu" class="doc-reference doc-reference-module"><code>module#mod_menu</code></a> for the required JavaScript files which make up the menu editor.
:::

Add support for editing [Categories](/id/doc_userguide_datamodel#guide-datamodel-categories) in the admin, by presenting an editable category tree at `http://yoursite.com/admin/category`.

ACL permissions
---------------

The following [ACL permissions](/id/doc_developerguide_access_control#guide-authorization) are required:

- to view the page, the `use` permission on the ‘mod\_admin\_category’ module; see <a href="/id/doc_module_mod_acl_user_groups" class="doc-reference doc-reference-module"><code>module#mod_acl_user_groups</code></a>
- to view the list of categories, `view` permission on category ‘category’; see <a href="/id/doc_module_mod_acl_user_groups" class="doc-reference doc-reference-module"><code>module#mod_acl_user_groups</code></a>
- to edit and re-order the categories, `edit` permission on category ‘category’; see <a href="/id/doc_module_mod_acl_user_groups" class="doc-reference doc-reference-module"><code>module#mod_acl_user_groups</code></a>. Admin module for managing category trees and category resources in the backend.

Accepted Events
---------------

This module handles the following notifier callbacks:

- `observe_admin_menu`: Contribute module entries to the admin menu tree.
- `observe_category_hierarchy_save`: Check edit permissions and persist category hierarchy changes from the admin UI.
- `observe_rsc_delete`: Do not allow a category to be removed iff there are resources within that category using `m_category:is_used`.

Delegate callbacks:

- `event/2` with `postback` messages: `delete_all`.
- `event/2` with `submit` messages: `delete_move`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1842?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/1842?language=en>)
