# controller\_admin\_media\_preview

Source: https://zotonic.com/docs/1542/controller_admin_media_preview

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

Language: en



A controller for rendering preview thumbnails of any media embedded in a richtext-editor component of a [resource](/id/doc_glossary#term-resource) on the <a href="/id/doc_controller_controller_admin_edit" class="doc-reference doc-reference-controller"><code>controller#controller_admin_edit</code></a> page.

The `id` path or query argument can be a resource id or name. The resource must exist and be visible to the current user. A successful request redirects with HTTP 303 to the image generated with the `admin-editor` mediaclass; missing media returns 404.

The controller is normally addressed through the `admin_media_preview` dispatch rule:

```django
<img src="{% url admin_media_preview id=id %}" alt="">
```

License: 

Attribution: 

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