# temporary\_rsc

Source: https://zotonic.com/docs/1459/temporary_rsc

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

Language: en



Creates a temporary resource if its input value is not defined.

The created resource receives the properties of the second parameter.

After the resource is created, every hour a check is made if the resource has been edited and still registered in the Server Storage.

::: {.note title="Note"}
`mod_server_storage` must be enabled for this filter to work.
:::

If the resource is abandoned and not changed since its creation, then it is automatically deleted.

Only a single temporary resource can exist per category per session. Requesting a second resource of the same category for a session will return the earlier created resource. If the earlier resource has been updated, then a new resource is created.

This filter is used for situations where an edit form is needed but an intermediate dialog requesting for the title of the resource is unwanted.

Example:

```none
{% with id|temporary_rsc:%{ title:_"New", category_id: `article` } as id %}
    {% wire id=#form type="submit" postback=`rscform` delegate=`controller_admin_edit` %}
    <form id="{{ #form }}" action="postback">
        <input type="hidden" name="id" value="{{ id }}" />
        <input type="hidden" name="is_published" value="1" />
        <input type="text" name="title" value="{{ id.title }}" />
        ...
    </form>
{% endwith %}
```

See <a href="/id/doc_module_mod_admin" class="doc-reference doc-reference-module"><code>module#mod_admin</code></a>, <a href="/id/doc_module_mod_server_storage" class="doc-reference doc-reference-module"><code>module#mod_server_storage</code></a>

License: 

Attribution: 

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