# development\_filename

Source: https://zotonic.com/docs/3089/development_filename

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

Language: en



Format a source filename for display in development tools. Resolves symbolic links in both files and parent directories, then removes the Zotonic root directory from paths inside that root. This makes template viewer, cross-reference and language server paths easier to read.

For example:

```django
{{ template_file|development_filename|escape }}
```

With Zotonic installed in `/home/developer/zotonic`, the filename `/home/developer/zotonic/apps/mysite/priv/templates/page.tpl` is displayed as `apps/mysite/priv/templates/page.tpl`. A development build path whose `priv` directory links to the source directory is first resolved to that source path. The root itself is displayed as `.`.

Absolute paths outside the Zotonic root retain their full resolved path. Relative paths are left unchanged. An undefined input returns `undefined`; other supported filename inputs return a binary. If symlink resolution fails, the original path is used for root-relative formatting. Link traversal is limited to prevent cycles.

The root is obtained from `z_path:get_path()` and is resolved through symlinks too. It refers to the Zotonic installation, not the current site's directory.

This filter formats labels only: retain the original filename for opening files or generating editor links. It does not check access permissions or HTML-escape the result; use `escape` when displaying it in HTML, as in the example above.

License: 

Attribution: 

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