Documentation
mod_export - Fetch the header for the export.
mod_export - Check if the resource or dispatch is visible for export.
Inherit markup from another template.
Show an element by animating the opacity.
Hide an element by animating the opacity.
This filter formats a numeric value as KB, MB etc. This filter can be used to display a number of bytes in a human…
Broadcast some file changed, used for livereload by mod_development
Filters a list on the value of a property, either on presence or equality.
Filter the contents of a block through variable filters.
Applying Erlang Binary syntax to get fast character manipulation.
Returns the first character or element.
Not implemented, but exists in Zotonic for forward compatibility with future ErlyDTL and Django versions.
Replaces ampersands in the value with “&” entities.
Flatten a list to a comma separated string.
Add a $(..).focus() jQuery call to the target element to give it input focus.
Loop over multiple values in a list or search result.
HTML escapes a text.
Regular expression test.
format_dispatch_controller_option
Format dispatch controller options.
Format dispatch path element so variables will be more visible.
Show a duration in hours, minutes and seconds.
Show an integer value.
Show an integer or float.
Show a price with decimals.
Resets the target form to its initial state.
pickle
disable enable event focus form_reset reset set_value submit typeselect validation_error
You should validate all input data entered in forms. In Zotonic you create forms by writing plain HTML. You can attach…
Parse a string as a JSON (JavaScript Object Notation) value. The returned value can be processed futher.
These cookbook entries contain valuable nuggets of information regarding the frontend development of a site.
You have three options for running Zotonic: to get started quickly, start our Zotonic container. You can also use Nix…
This section describes the location and contents of Zotonic’s global configuration files erlang.config and zotonic.
These variables are always available for rendering in templates.
Action An action is functionality that can be attached to a HTML element or event. Actions are wired to an element or…
Make charts with Google.
Calculate the gravatar code for an e-mail address:
Groups items of a list by a property.
Group a list of sorted resource ids on their first letter of the title or another rsc property. After grouping, it…
Similar to group_firstchar, but always uses the title column from the rsc table.
Show a message in the upper right corner of the browser window. The message will automatically disappear after some…
A validator to check if a resource has a certain number of edges with a predicate.
Hide an element without any animation.
Signal that the hierarchy underneath a resource has been changed by mod_menu
How to add a custom page block
Zotonic comes with a number of standard page blocks: Header, Text and Embed page. Additional page blocks are provided…
Specific error pages Zotonic’s controller_http_error first tries to find an error page template that is specific for…
show_media striptags truncate_html sanitize_html sanitize_url urlize embedded_media without_embedded_media render…
Access log event for http. Called from the z_stats.
Zotonic has built-in support for HTTPS and TLS (previously SSL) certificate handling.
Including Zotonic icons CSS Add the CSS file to your template:
Zotonic provides a couple of ways to show icons in templates:
Check if passwords are matching. Uses the password hashing algorithms.
Notify that a user’s identity has been updated by the identity model.
Request to send a verification to the user. Return ok or an error. Handled by mod_signup to send out verification…
Notify that a user’s identity has been verified. Signals to modules handling identities to mark this identity as…
Show something if the condition is true.
Selects an argument depending on a condition.
Not implemented, but exists in Zotonic for forward compatibility with future ErlyDTL and Django versions.
Show something if two values are equal.
Show something if two values are not equal.
Tests whether a value is undefined, returning the given argument.
Show a still image using an <img> element. The image will be automatically resized to the desired size and filters. For…
Generate a data: url of a still image.
Generate the url of a still image.
Implementing a simple contact form
This tutorial teaches you to create a form, validate it, submit it over Ajax and e-mail the results back to you.
Find an import definition for a CSV file by checking the filename of the to be imported file.
import_csv_definition import_resource export_resource_content_disposition export_resource_content_type…
An external feed delivered a resource. First handler can import it. Return:: {ok, m_rsc:resource_id()} , {error
Include another template. The include tag is replaced with the contents of the included template file. You can give…
Returns the index of the first occurrence of the item in the given list.
Tests if a date is in the future.
Include the markup of an extended template into the extending template.
Adds recipient query string details to hyperlinks.
Tests if a date is in the past.
Render a JS-aided inplace textbox.
Prepends the argument in front of the value.
Insert the result of a render action after of an HTML element.
Insert the result of a render action before an HTML element.
Inserts HTML after the contents of an HTML element.
Inserts HTML before the contents of an HTML element.
Zotonic runs on Linux, Mac OS X and (not officially) on Windows.
This is the Zotonic Developer Guide. It takes you through all aspects of Zotonic so you can start building your own…
Maps an IP address to a country using the MaxMind GeoIP2 database.
Maps an IP address to information about that country.
Filter a list of resource ids on category, or test if a single resource id belongs to a category.
Tests if a value is defined.
Test if an integer value is even:
Test if a hostname can be used for a Let’s Encrypt certificate.
Test if a value is a list:
is_not_a mirrors is_a. It is particularly useful when iterating over a category and excluding members of a sub-category…
Test if a value is a number (integer or floating point):
Check if the given language is a rtl or ltr language.
Test if the given URL is a url for the current site.
If you encounter any issues in using Zotonic, or have ideas for new features, please let us know at the Zotonic issue…
Tests if a value is undefined.
Filter a list of resource ids so that only the visible ids remain.
script
Adds javascript that will be run after jQuery has been initialized. In dynamic content it will run after the DOM has…
Joins the elements of a list. Joins the elements of the input list together, separated by the argument.
Trigger various jQuery effects on the target element. Mostly, each of these effects have their own action as a shortcut