# zmedia

Source: https://zotonic.com/docs/2114/zmedia

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

Language: en



Used for triggering the insertion of a media item in the TinyMCE editor in the admin.

The action opens `_action_dialog_zmedia_choose.tpl`. Its arguments are passed to that dialog, including the current resource `id`, `subject_id`, and the editor's `media_div_id` when supplied.

```django
{% button text="Add media" action={zmedia id=id subject_id=id media_div_id="body-media"} %}
```

The chooser finishes through the internal `zmedia_choose` and `zmedia_has_chosen` actions.

License: 

Attribution: 

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