# Add your first dynamic page

Source: https://zotonic.com/docs/2916/add-your-first-dynamic-page

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

Language: en

Use an existing controller and a template for a simple dynamic page.

For a new dispatch file, use the complete list below. In an existing dispatch list, insert the tuple before broader matching rules and separate entries with commas:

```erlang
[
    {garden_welcome, ["welcome"], controller_template,
        [{template, "garden_welcome.tpl"}]}
].
```

Create `priv/templates/garden_welcome.tpl`:

```django
{% extends "base.tpl" %}
{% block content %}
    <h1>{_ Welcome _}</h1>
    <p>{{ m.site.title|escape }}</p>
{% endblock %}
```

Confirm that your generated `base.tpl` has a `content` block; adapt the block name if it differs. Reload `/welcome` on the site's configured hostname and check that the site title appears.

Use `{% url garden_welcome %}` to link to this route. For ordinary CMS content, prefer resource page URLs instead of inventing a dispatch rule per page. See [Follow a request to its template](/id/2940) and [Link to resources and dispatch routes](/id/2944).

Save the dispatch list as `apps_user/garden/priv/dispatch/garden` (create the directory if needed). Save the template under `apps_user/garden/priv/templates/`. After file handling has refreshed the rules, run `bin/zotonic dispatch garden /welcome`; expect the `garden_welcome` rule and `controller_template` before checking the browser.

License: 

Attribution: 

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