dialog_media_upload

Shows the admin dialog for uploading a media item. See Media.

The dialog accepts either a local file or a URL.

Arguments:

  • intent is create, connect, select, or update. It defaults to update when id is present and to connect otherwise.
  • id identifies the media resource whose file is replaced for update.
  • subject_id and predicate connect a newly created medium to a resource; predicate defaults to depiction.
  • title overrides the dialog heading.
  • stay prevents redirecting after creation.
  • center controls the dialog's centering option and defaults to 1.
  • action can be repeated to run actions after a successful upload.
  • callback names a safe JavaScript callback that receives the new media id.
{% button text="Add image" action={dialog_media_upload intent="connect" subject_id=id predicate="depiction"} %}

Edit on GitHub

Referred by

Category

Actions

Browser actions that templates attach to events with Zotonic's wiring system.