# dialog\_open

Source: https://zotonic.com/docs/1614/dialog_open

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

Language: en



Renders a template on the server and opens a dialog with the HTML output of the template.

Example:

```django
{% button text="cancel" action={dialog_open title="Select a name" template="_select_name.tpl" arg=100} %}
```

The title of this new dialog will be “Select a name”, its contents are the output of rendering the template “\_select\_name.tpl”. All arguments are handed as arguments to the template. In this example the template “\_select\_name.tpl” is rendered with the arguments “title”, “template” and “arg”.

There can be many levels of dialogs open, they are designated by a *level*, the default dialog opens at level 0. Higher levels are displayed above lower levels. There is a special level `"top"` which ensures that a dialog is always opened above any other open dialog.

Example, opening a dialog above the default dialog:

```django
{% button text="ok" action={dialog_open title="Confirm" template="_confirm.tpl" level=1} %}
```

Example, opening a dialog above any open dialog:

```django
{% button text="ok" action={dialog_open title="Confirm" template="_confirm.tpl" level="top"} %}
```

License: 

Attribution: 

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