# controller\_admin

Source: https://zotonic.com/docs/1330/controller_admin

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

Language: en



The admin controller is the main controller behind which admin pages are served. Its main purpose is that it does an authentication check (Is current user allowed to `use` the module `mod_admin`).

The template parameter decides which admin template gets served, and defaults to admin.tpl.

Dispatch options
----------------

| Option       | Description                                                                 |
| ------------ | --------------------------------------------------------------------------- |
| `template`   | Template rendered for the request. Defaults to `admin.tpl`.                 |
| `selected`   | Name of the active admin navigation item. Defaults to `dashboard`.          |
| `acl_module` | Module checked for the `{use, Module}` permission. Defaults to `mod_admin`. |

All dispatch and request arguments are passed to the template. A typical dispatch rule is:

```erlang
{admin_overview_rsc, ["admin", "overview"], controller_admin, [
    {template, <<"admin_overview.tpl">>},
    {selected, <<"overview">>},
    seo_noindex
]}
```

Request handling
----------------

The controller disables caching and indexing, checks the configured module permission, renders the selected template, and returns the generated HTML. Use a more specific controller when a page needs resource lookup, form processing, or a response format other than the standard admin HTML page.

License: 

Attribution: 

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