Reference

All Reference

identity_update_done

Notify that a user’s identity has been updated by the identity model.

identity_verification

Request to send a verification to the user. Return ok or an error. Handled by mod_signup to send out verification…

identity_verified

Notify that a user’s identity has been verified. Signals to modules handling identities to mark this identity as…

if

Selects an argument depending on a condition.

if

Show something if the condition is true.

ifchanged

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

ifequal

Show something if two values are equal.

ifnotequal

Show something if two values are not equal.

if_undefined

Tests whether a value is undefined, returning the given argument.

image

Show a still image using an <img> element. The image will be automatically resized to the desired size and filters. For…

image_data_url

Generate a data: url of a still image.

image_url

Generate the url of a still image.

import_csv_definition

Find an import definition for a CSV file by checking the filename of the to be imported file.

Import/export notifications

import_csv_definition import_resource export_resource_content_disposition export_resource_content_type…

import_resource

An external feed delivered a resource. First handler can import it. Return:: {ok, m_rsc:resource_id()} , {error

include

Include another template. The include tag is replaced with the contents of the included template file. You can give…

index_of

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

in_future

Tests if a date is in the future.

inherit

Include the markup of an extended template into the extending template.

inject_recipientdetails

Adds recipient query string details to hyperlinks.

in_past

Tests if a date is in the past.

inplace_textbox

Render a JS-aided inplace textbox.

insert

Prepends the argument in front of the value.

insert_after

Insert the result of a render action after of an HTML element.

insert_before

Insert the result of a render action before an HTML element.

insert_bottom

Inserts HTML after the contents of an HTML element.

insert_top

Inserts HTML before the contents of an HTML element.

Installation requirements

Zotonic runs on Linux, Mac OS X and (not officially) on Windows.

ip2country

Maps an IP address to a country using the MaxMind GeoIP2 database.

ip2geo

Maps an IP address to information about that country.

is_a

Filter a list of resource ids on category, or test if a single resource id belongs to a category.

is_defined

Tests if a value is defined.

is_even

Test if an integer value is even:

is_letsencrypt_valid_hostname

Test if a hostname can be used for a Let’s Encrypt certificate.

is_list

Test if a value is a list:

is_not_a

is_not_a mirrors is_a. It is particularly useful when iterating over a category and excluding members of a sub-category…

is_number

Test if a value is a number (integer or floating point):

is_rtl

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

is_site_url

Test if the given URL is a url for the current site.

is_undefined

Tests if a value is undefined.

is_visible

Filter a list of resource ids so that only the visible ids remain.

javascript

Adds javascript that will be run after jQuery has been initialized. In dynamic content it will run after the DOM has…

join

Joins the elements of a list. Joins the elements of the input list together, separated by the argument.

jquery_effect

Trigger various jQuery effects on the target element. Mostly, each of these effects have their own action as a shortcut

language

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

language

Notify that the session’s language has been changed

language_detect

Try to detect the language of a translation. Set is_editable_only to false to detect any language, even if the language…

language_dir

Return rtl or ltr depening on the direction of the language.

language_sort

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

last

Returns the last character or element.

lazy

Custom tag which adds a ‘loader’ image to the page and performs a one-time action when loader comes into view.

length

Returns the length of the value.

length

Check the length of a text input.

lib

Combine css and javascript includes in a single request.

linebreaksbr

Translate ASCII newlines ( \n ) into HTML <br /> elements.

link

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

Lists

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

live

Live updating templates connected to MQTT topics.

ljust

Justifies the value in a field of a certain width to the left, with spaces.

load

Loads the given custom tags for use in the templates. Normally not needed, as custom tags are automatically loaded…

log_format_stack

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

logoff

This action logs off the current user and reloads the current page as the anonymous visitor.

logon_options

Check for logon options, called if logon_submit returns undefined . This is used to fetch external (or local…

logon_ready_page

Check where to go after a user logs on.

logon_submit

Handle a user logon. The posted query args are included. Return:: {ok, UserId} or {error, Reason}

loremipsum

Inserts a piece of “lorem ipsum” text into the page.

lower

Translates the value to lower case.

m_acl

The m_acl model gives access the id of the currently logged in user, and provides a mechanism to do basic access…

m_acl_rule

Not yet documented.

m_acl_user_group

Not yet documented.

m_admin

This model exposes some meta-information for the use in mod_admin templates.

m_admin_blocks

Not yet documented.

m_admin_config

Not yet documented.

m_admin_identity

Not yet documented.

m_admin_menu

This model holds the admin menu, which is built up by calling each module to add items to the menu.

m_admin_note

Add an editorial note to any resource.

m_admin_status

Not yet documented.

Mailing list

dialog_mail_page dialog_mailing_page mailing_page_test mailinglist_confirm mailinglist_unsubscribe

Mailing list

inject_recipientdetails mailinglist_recipient_key_decode

mailinglist_confirm

Confirm a mailinglist subscription. Required argument is the confirm_key .

mailinglist_mailing

Send a page to a mailinglist (notify) Use {single_test_address, Email} when sending to a specific e-mail address.

mailinglist_message

Send a welcome or goodbye message to the given recipient. The recipient is either a recipient-id or a recipient props.

mailinglist_recipient_key_decode

Used on the mailing list subscriptions page where users and recipients can unsubscribe from mailinglists.

mailinglist_subscribe

Show the mailinglist subscription form to subscribe to a certain mailinglist id.

mailinglist_unsubscribe

Cancel a mailing list subscription. The recipient id is given with the id argument.

mailing_page_test

Post a message to the test mailing list, given with the id argument.

make_list

Forces the value to a list.

mask

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

mask_progress

Sets the progress bar of a mask.

match

Match a value with a regular expression.

m_auth2fa

Not yet documented.

m_authentication

Not yet documented.

max

Take the maximum of the filter value and its first argument.

m_backup

Not yet documented.

m_backup_revision

Not yet documented.

m_category

This model can retrieve information about the resource category hierarchy in different ways.