Text

All Text

set_class

Set the class of an element.

effect

Add a $(..).effect jQuery call to the target element.

DOM Elements

add_class animate buttonize effect fade_in fade_out hide insert_after insert_before insert_bottom insert_top…

ratelimit

Model for exposing current ratelimit timeout information for the active request context.

observe_dropbox_file/2

Handle a new file received in the ‘files/dropbox’ folder of a site. Unhandled files are deleted after an hour. If the…

observe_sanitize_element/3

Sanitize an HTML element.

mod_media_exif

When uploading a file, this module extracts properties from the uploaded media and sets them in the resource.

submit

Submits the enclosing form, a specifically targeted form or the closest form to an element.

reset

Resets the enclosing form, a specifically targeted form or the closest form to an element.

form_reset

Resets the target form to its initial state.

event

Bind actions to a jQuery event or submit a form.

Forms

disable enable event focus form_reset reset set_value submit typeselect validation_error

log_ui

Model for admin UI log retrieval by index, gated by admin permissions.

moreresults

Show more results of the current search query inline on the page.

Search

moreresults

oauth2

Model for OAuth2 app/client/token administration and user token listings.

acl_rule

Model for ACL rule inspection and helper checks in mod_acl_user_groups, including insert/move checks, upload limits

observe_email_add_handler/2

Add a handler for receiving e-mail notifications

observe_email_received/2

Notification sent to a site when e-mail for that site is received

Issues and features

If you encounter any issues in using Zotonic, or have ideas for new features, please let us know at the Zotonic issue…

observe_url_rewrite/3

Rewrite a URL after it has been generated using the z_dispatcher

observe_dispatch_rewrite/3

Rewrite a URL before it will be dispatched using the z_sites_dispatcher

Dispatch notifications

content_types_dispatch dispatch dispatch_host dispatch_rewrite page_url url_abs url_rewrite

observe_content_types_dispatch/3

Get available content types and their dispatch rules Example: \{\{<<”text”>>, <<”html”>>, [\]\}, page\} A special…

log_email

Model for email log lookups used by logging/admin views.

mod_tkvstore

Simple (type,key)/value store. Stores data in the store with minimal latency and (local) serialization of get/put…

tkvstore

Simple read-only interface to the typed key-value store of mod_tkvstore. To get a value from the store: use m.tkvstore.

mask_progress

Sets the progress bar of a mask.

unmask

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

mask

Places a mask over an element, useful for blocking user interaction during lengthy postbacks.

mod_signup

This module presents an interface for letting users register themselves.

observe_ssl_options/2

Request the SSL certificates for this site. The server_name property contains the hostname used by the client. (first…

move

Move an element to another place, appending it to the target. The element is given by id with the element argument, or…

observe_module_activate/2

A module has been activated and started.

client_local_storage

Model to access the localStorage on the client (browser).

reload

Reload the current page.

redirect

This action redirects the browser to another page or back to the previous page.

Page handling

redirect reload

log

Model for runtime logging state and access to server log entries for clients allowed to read logs.

observe_rsc_merge/2

Map to signal merging two resources. Move any information from the loser to the winner. The loser will be deleted.

observe_survey_is_submit/2

Check if a question (page block) is a submitting question.

observe_survey_is_allowed_results_download/2

Check if the current user is allowed to download a survey.

observe_survey_get_handlers/3

Fetch list of handlers for survey submits.

Survey notifications

survey_get_handlers survey_is_allowed_results_download survey_is_submit survey_submit survey_result_columns…

observe_tkvstore_get/2

Get a value from the typed key/value store

observe_activity_send/2

Push a list of activities via a ‘channel’ (eg ‘email’) to a recipient. The activities are a list of

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…

mod_admin_statistics

Admin module exposing site statistics views and related dashboard metrics.

dispatch

Dispatch rules Name Path Resource Args admin_statistics [“admin”,”statistics”] controller_admin_statistics []…

Automatic startup on system boot

Once you have Zotonic running, you want to make sure that it automatically starts up when the server reboots, so that…

replace

Replace the target HTML element by new one.

typeselect

Show possible selections whilst typing.

observe_auth_postcheck/2

First for logon of user with username, called after successful password check.

survey

Model for survey reporting and participant state, including results, totals, per-user answers, exports, and result…

observe_search_query/2

Map a custom search term to a #search_sql_term{} record.

observe_rsc_update_done/2

An updated resource has just been persisted. Observe this notification to execute follow-up actions for a resource…

Variables

as_atom default if if_undefined is_defined is_undefined make_value pprint to_binary to_integer to_json from_json…

Translation

is_rtl language language_dir language_sort language_sort_localized media_for_language set_url_language trans_languages…

Strings

append capfirst center filesizeformat format_duration format_integer format_number format_price insert is_valid_email…

Numbers

filesizeformat format_duration format_integer format_number format_price is_even is_number max min minmax rand round…

Miscellaneous

gravatar_code ip2country ip2geo is_letsencrypt_valid_hostname format_dispatch_controller_option…

Menu

menu_flat menu_ids menu_is_visible menu_expand menu_rsc menu_subtree menu_trail

Lists

after before chunk exclude filter first flatten_value group_by index_of is_list join last length make_list member…

HTML

show_media striptags truncate_html sanitize_html sanitize_url urlize embedded_media without_embedded_media render…

Forms

pickle

Character escaping

brlinebreaks escape escape_check escape_ical escape_link escapejs escapejson escapexml fix_ampersands force_escape…

Encryption

md5 sha1

Binaries

first last length to_binary

to_json

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

default

Provide an alternative value in case a value has a falsy value (0, false , undefined or empty string).

trans_filter_filled

Filters all empty translations from a property.

language_sort

Sort a list of language codes or map with languages on their sort key. Return a list of {Code, LanguageProps} pairs.

language

Return the language the resource (or translated text) will be displayed in.

is_rtl

Check if the given language is a rtl or ltr language.

truncate

Truncate a text to a maximum length.

trim

Removes whitespace at the start and end of a string.

to_name

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

insert

Prepends the argument in front of the value.

log_format_stack

Escapes and formats a Javascript string with a stack trace to readable HTML.

append

Appends the argument to the value.

to_integer

Convert the input to an integer value.

round

Round a floating point value to the nearest integer.

is_even

Test if an integer value is even:

filesizeformat

This filter formats a numeric value as KB, MB etc. This filter can be used to display a number of bytes in a human…

ip2geo

Maps an IP address to information about that country.

gravatar_code

Calculate the gravatar code for an e-mail address:

menu_is_visible

Filters a list of menu items on visibility and existance. Only top-level menu items that are both visible and exist are…

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…

split_in

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

sort

The sort filter takes a list of items to sort. Items can be an ordinary list of terms, property lists, or maps. It can…

range

Generate a list of integers, with an optional step.

member

Finds a value in a list.

make_list

Forces the value to a list.

is_list

Test if a value is a list:

index_of

Returns the index of the first occurrence of the item in the given list.

group_by

Groups items of a list by a property.

flatten_value

Flatten a list to a comma separated string.

before

Return the first element before another element in a list. For example: