Documentation

All Documentation

survey_is_stop

Check if there is a ‘stop’ question in list of (survey) blocks

survey_is_submit

Check if a question is a submitting question.

Survey notifications

survey_get_handlers survey_is_allowed_results_download survey_is_submit survey_submit survey_result_columns…

survey_result_columns

Add header columns for export. The values are the names of the answers and the text displayed above the column. The…

survey_result_column_values

Modify row with answers for export. The header columns are given and the values that are known are set in the folded…

survey_result_column_values

Used by the survey module to add extra column values to the result editor.

survey_submit

A survey has been filled in and submitted.

survey_test_max_points

Counts the total of all points that can be received for all test questions. Non test questions are not counted.

tabs

Make a HTML element into a tab set.

tail

Fetch the tail of a list.

template

Render a template. When used in a postback action, the result will be sent back with the response data for the postback.

Template Best Practices and Pitfalls

This chapter lists some preferred solutions to common tasks and pitfalls you may encounter while developing with…

Templates

Templates are text files marked up using the Zotonic template language. Zotonic interprets that mark-up to dynamically…

Templates

template

templatetag

Not implemented, but exists in Zotonic for forward compatibility with future ErlyDTL and Django versions.

temporary_rsc

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

Testing sites

It is possible to create end-to-end integration tests for Zotonic websites. Tests like these are called sitetests .

tests

Dispatch rules Name Path Resource Args hello_world [“test”,”hello_world”] controller_hello_world []…

The addsite command

Adding a site to Zotonic is done through the zotonic shell command. It syntax is like this:

The Status site

The Zotonic “status” site is the first thing you see once you have installed Zotonic, or if you do not have any sites…

The Zotonic data model

Zotonic’s data model is a pragmatic implementation of the Semantic Web: a mixture between a traditional database and a…

timesince

Show a readable version of a date/time difference.

tkvstore_delete

Delete a value from the typed key/value store

tkvstore_get

Get a value from the typed key/value store

tkvstore_put

Put a value into the typed key/value store

to_binary

Convert the input to a binary value.

toc

Filter to derive a Table Of Contents from a HTML body.

toggle

Toggle the visibility of an element.

toggle_class

Toggle a CSS class from an HTML element.

to_integer

Convert the input to an integer value.

to_json

Display any value as in JSON (JavaScript Object Notation).

tokens

Returns a list of tokens from input string, separated by the characters in the filter argument.

to_name

Map a string to a name . That is a lowercased string with only [a-z0-9_] characters.

trans_filter_filled

Filters all empty translations from a property.

translate

Translate a text value using gettext.

translate

Request a translation of a list of strings. The resulting translations must be in the same order as the request. This…

translate

Translates a (English) value to the current language or the given language.

translation

Lookup a specific translation in a translated text. If the text is not translated then the text is returned as-is.

Translation

is_rtl language language_dir language_sort media_for_language set_url_language trans_filter_filled translation…

Translation

Many sites need to support content and templates in multiple languages. Luckily, Zotonic is completely multilingual

trans (variable substitution)

Translate a text value using gettext and substitute variables.

trigger_event

Trigger a named {% wire %} with an action. All args will be args to the named wire. The trigger’s name argument is the…

trim

Removes whitespace at the start and end of a string.

Troubleshooting

Installation Zotonic won’t start and shows errors when running zotonic debug Check your site’s database configuration.

truncate

Truncate a text to a maximum length.

truncatechars

Truncate a text to a maximum length in characters.

truncate_html

Truncate a HTML text to a maximum length.

Tuples

element

typeselect

Show possible selections whilst typing.

unescape

Removes HTML escaping from a text.

unlink

Remove an edge between two resources. Used in the admin.

unmask

Removes a mask that was placed over an element using the mask action.

update

Updates the content of an HTML element with a template or a literal HTML text.

update_iframe

Updates the content of an iframe with a template or a literal HTML text.

Updating form field from a dialog

Ever wanted to update a form field from a dialog, possibly giving the user some list to choose from? Here’s how to do…

Upgrade notes

These notes list the most important changes between Zotonic versions. Please read these notes carefully when upgrading…

upper

Translates the value to upper case.

url

Generates the relative URL for the given dispatch information.

url

Generate the URL for a named dispatch rule. In this way it is possible to automatically change the generated URLs when…

url_abs

Generates an absolute URL for the given dispatch information.

url_abs

Make a generated URL absolute, optionally called after url_rewrite by z_dispatcher

urldecode

Decode a text where characters are encoded as URL-safe characters.

urlencode

Make a text safe for URLs.

url_fetch_options

Determine the URL fetch options for fetching the content of an URL. Used by z_fetch.erl.

urlize

Find urls in the given input and make them clickable.

url_rewrite

Rewrite a URL after it has been generated using the z_dispatcher

URLs and links

is_site_url url url_abs sanitize_url is_letsencrypt_valid_hostname urlize escape_link urlencode urldecode parse_url…

Useful environment variables

The following environment variables influence how Zotonic starts up.

User

auth_disconnect delete_username dialog_delete_username dialog_set_username_password dialog_user_add logoff…

user_context

Set #context fields depending on the user and/or the preferences of the user.

User Guide

Welcome to the Zotonic User Guide. This guide is a non-technical introduction to Zotonic.

user_is_enabled

Check if a user is enabled. Enabled users are allowed to log in. Return true , false or undefined . If undefined is…

User management

Create new users In the admin, under ‘Auth’ > ‘Users’ you can find a list of all users. Use the ‘Make a new user’…

username_unique

Check if an entered username is unique, by looking in the m_identity table for the given username:

User notifications

identity_password_match identity_verification identity_verified logon_options logon_ready_page logon_submit…

Using Varnish as frontend for Zotonic

Using the Varnish HTTP frontend, you can speed up your Zotonic even more as this web server caches static files…

utc

Translates a datetime from local time to UTC.

validate

The validator tag accepts the following arguments:

validate_query_args

Called just before validation of all query arguments by z_validation. This is the moment to filter any illegal…

validation_error

Render a validation error on the target. Text is given in the text argument.

Variables

as_atom default if if_undefined is_defined is_undefined make_value pprint to_binary to_integer to_json

vsplit_in

This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is…

wire

Connect actions and events to a HTML element.

wire_args

Add extra arguments to wired actions.

Wires

Wires are the older way to code actions and client/server interaction. It is now advised to use MQTT topics with…

with

Assign a complex value to a variable.

with_args

Apply actions with arguments added.

without

Remove the items given in the argument from the filter value.

without_embedded_media

Filter out media ids that are embedded in the body , body_extra and text blocks of your page.

yesno

Show a boolean value as a text.

zlink

Used for inserting an internal link in the TinyMCE editor in the admin.

zmedia

Used for triggering the insertion of a media item in the TinyMCE editor in the admin.

zmedia_choose

Used after a media item is selected in the media chooser for the TinyMCE editor.

zmedia_has_chosen

Used by the admin as a callback when a media file has been selected for insertion into the rich-text editor.