Documentation
Subtracts an hour from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Submits the enclosing form, a specifically targeted form or the closest form to an element.
Subtracts a month from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Subtracts a week from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Subtracts a year from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Extract a summary from a resource.
survey_answer_split survey_any_correct_answer survey_any_wrong_answer survey_as_pages survey_is_stop survey_is_submit…
Dispatch rules Name Path Resource Args survey_results_download [“survey”,”results”,”download”,id]…
Determine if any answer of a question was correct. Used for showing results of thurstone test questions.
Determine if any answer of a question was wrong. Used for showing results of thurstone test questions.
Split the page blocks into pages, prepare them for easy display in the survey question editor.
Fetch list of handlers for survey submits.
survey_is_allowed_results_download
Check if the current user is allowed to download a survey.
Check if a list of questions contains a pagebreak block with an unconditional submit.
Check if there is a ‘stop’ question in list of (survey) blocks
Check if a question (page block) is a submitting question.
survey_get_handlers survey_is_allowed_results_download survey_is_submit survey_submit survey_result_columns…
Add header columns for export. The values are the names of the answers and the text displayed above the column. The…
Used by the survey module to add extra column values to the result editor.
Modify row with answers for export. The header columns are given and the values that are known are set in the folded…
A survey has been filled in and submitted.
Counts the total of all points that can be received for all test questions. Non test questions are not counted.
Make a HTML element into a tab set.
Fetch the tail of a list.
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…
Define a template block and overrules a template block from an inherited template.
template
Templates are text files marked up using the Zotonic template language. Zotonic interprets that mark-up to dynamically…
Not implemented, but exists in Zotonic for forward compatibility with future ErlyDTL and Django versions.
Creates a temporary resource if its input value is not defined.
It is possible to create end-to-end integration tests for Zotonic websites. Tests like these are called sitetests .
Dispatch rules Name Path Resource Args hello_world [“test”,”hello_world”] controller_hello_world []…
Adding a site to Zotonic is done through the zotonic shell command. It syntax is like this:
The Zotonic “status” site is the first thing you see once you have installed Zotonic, or if you do not have any sites…
Zotonic’s data model is a pragmatic implementation of the Semantic Web: a mixture between a traditional database and a…
Show a readable version of a date/time difference.
Delete a value from the typed key/value store
Get a value from the typed key/value store
Put a value into the typed key/value store
Convert the input to a binary value.
Filter to derive a Table Of Contents from a HTML body.
Toggle the visibility of an element.
Toggle a CSS class from an HTML element.
Convert the input to an integer value.
Display any value as in JSON (JavaScript Object Notation).
Returns a list of tokens from input string, separated by the characters in the filter argument.
Map a string to a name . That is a lowercased string with only [a-z0-9_] characters.
Filters all empty translations from a property.
Return a list of all languages present in the given translated text ( #trans{} record).
Translate a text value using gettext.
Request a translation of a list of strings. The resulting translations must be in the same order as the request. This…
Translates a (English) value to the current language or the given language.
is_rtl language language_dir language_sort media_for_language set_url_language trans_languages trans_filter_filled…
Many sites need to support content and templates in multiple languages. Luckily, Zotonic is completely multilingual
Lookup a specific translation in a translated text. If the text is not translated then the text is returned as-is.
Translate a text value using gettext and substitute variables.
Trigger a named {% wire %} with an action. All args will be args to the named wire. The trigger’s name argument is the…
Removes whitespace at the start and end of a string.
Installation Zotonic won’t start and shows errors when running zotonic debug Check your site’s database configuration.
Truncate a text to a maximum length.
Truncate a text to a maximum length in characters.
Truncate a HTML text to a maximum length.
element
Show possible selections whilst typing.
Removes HTML escaping from a text.
Remove an edge between two resources. Used in the admin.
Removes a mask that was placed over an element using the mask action.
Updates the content of an HTML element with a template or a literal HTML text.
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…
These notes list the most important changes between Zotonic versions. Please read these notes carefully when upgrading…
Translates the value to upper case.
Generates the relative URL for the given dispatch information.
Generate the URL for a named dispatch rule. In this way it is possible to automatically change the generated URLs when…
Make a generated URL absolute, optionally called after url_rewrite by z_dispatcher
Generates an absolute URL for the given dispatch information.
Decode a text where characters are encoded as URL-safe characters.
Make a text safe for URLs.
Determine the URL fetch options for fetching the content of an URL. Used by z_fetch.erl.
Find urls in the given input and make them clickable.
Rewrite a URL after it has been generated using the z_dispatcher
is_site_url url url_abs sanitize_url is_letsencrypt_valid_hostname urlize escape_link urlencode urldecode parse_url…
The following environment variables influence how Zotonic starts up.
auth_disconnect delete_username dialog_delete_username dialog_set_username_password dialog_user_add logoff…
Set #context fields depending on the user and/or the preferences of the user.
Welcome to the Zotonic User Guide. This guide is a non-technical introduction to Zotonic.
Check if a user is enabled. Enabled users are allowed to log in. Return true , false or undefined . If undefined is…
Create new users In the admin, under ‘Auth’ > ‘Users’ you can find a list of all users. Use the ‘Make a new user’…
Check if an entered username is unique, by looking in the m_identity table for the given username:
identity_password_match identity_verification identity_verified identity_update_done logon_options logon_ready_page…
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…
Translates a datetime from local time to UTC.
The validator tag accepts the following arguments:
Called just before validation of all query arguments by z_validation. This is the moment to filter any illegal…