Documentation

All Documentation

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

json

Todo

Just enough…

These Cookbook items each represent a stage in some Zotonic users’ journeys to understand the workings of Erlang and…

Just enough Erlang/OTP and rebar, part 1

Zotonic source code have you scratching your head? Learn Rebar first.

Just enough Erlang/OTP and rebar, part 2

Building a gen_server to front the library and generating documentation.

Just enough Erlang shell

An indispensible tool for both learning and programming Erlang.

Just enough Postgres

Understand the primary data-store of Zotonic.

Just Enough Regular Expressions (in Erlang)

Learn how to manipulate string data with the re module.

l10n

Model for localization helpers, including countries, country names, available timezones, and site timezone settings.

language

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

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 sort key. Return a list of {Code, LanguageProps} pairs.

language_sort_localized

Sort a list of language codes or map with languages on their localized name in the currently selected language. This is…

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

Check the length of a text input.

length

Returns the length of the value.

lib

See also

linebreaksbr

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

link

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

linkedin

Model for LinkedIn integration helpers, currently exposing whether LinkedIn auth integration is enabled.

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

See also

log

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

log_email

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

log_format_stack

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

Logging

Zotonic uses Logger for logging. Logger metadata is automatically set by Zotonic in the controller functions.

Logging to Logstash

Logstash is often used for log centralization and analysis. This cookbook describes how to set up Zotonic for logging…

logoff

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

log_ui

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

loremipsum

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

lower

Translates the value to lower case.

Mailing list

inject_recipientdetails mailinglist_recipient_key_decode

Mailing list

dialog_mail_page dialog_mailing_page mailing_page_test mailinglist_confirm mailinglist_unsubscribe

mailinglist

Model for mailinglist operations and reporting, including recipient counts, delivery stats, subscriptions, and…

mailinglist_confirm

Confirm a mailinglist subscription. Required argument is the confirm_key .

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.

Managing redirection after login and signup

Configure mod_signup to redirect to something other than a member’s home page.

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.

max

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

md5

Translates a string to a md5 hex value.

media

Access to data about uploaded files and other media.

media

See also

Media

Resources can have media resources attached to them. Resources and their media (images, video and audio) are connected…

Media Best Practices

Use Media classes to define image properties.

media_for_language

Filter a list of media items by their medium_language property, return the best matching with the current or given…

media_import_props

Notification to translate or map a file after upload, before insertion into the database Used in mod_video to queue…

Media notifications

media_identify_extension media_identify_file media_import media_import_medium media_preview_options media_import_props…

member

Finds a value in a list.

Menu

menu_flat menu_ids menu_is_visible menu_expand menu_rsc menu_subtree menu_trail

menu

Show a page menu.

menu_expand

Takes a menu, or a menu resource id, and adds all haspart objects connected to the menu ids.

menu_flat

Flattens the rsc menu structure for use in a template loop.

menu_ids

Returns all resource ids in a menu. Could return invisible and non existing resource ids. The returned ids are a flat…

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…

menu_rsc

Return the menu to be displayed with a resource.

menu_subtree

Get the subtree of an id in a menu (if any).

menu_trail

Return a breadcrumb navigation trail for the given id.

merge_tags

A mail-merge like filter where tag-expressions in a text are replaced with the value of their evaluation.

microsoft

Check with useauth if the authentication using the Microsoft identity platform is enabled and configured.

min

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

minmax

Force the given value in the given range.

Miscellaneous

gravatar_code ip2country ip2geo is_letsencrypt_valid_hostname format_dispatch_controller_option…

mod_acl_mock

Mocking module for access control during tests.

mod_acl_user_groups

This module adds rule-based access control.

mod_admin

Admin backend module that wires the core admin interface, assets, and admin-specific event handling.

mod_admin_config

Add support for editing the site’s configuration values, as accessed through m_config.

mod_admin_frontend

Adds editing of resources, menu-trees and collections for non-admin users.

mod_admin_identity

Provides identity management in the admin - for example the storage of usernames and passwords.

mod_admin_merge

Adds functonality to merge two pages together into a single page.

mod_admin_modules

Adds support in the admin for activating and deactivating modules.

mod_admin_predicate

Add support for editing predicates in the admin, by presenting a list of all defined predicates on http://yoursite.com…

mod_admin_statistics

Admin module exposing site statistics views and related dashboard metrics.

mod_artwork

This module contains many useful icons and images.

mod_audio

Adds support for viewing and handling audio medium items.

mod_auth2fa

Two-factor authentication module adding TOTP setup, verification flows, and related auth checks.

mod_authentication

This module contains the main Zotonic authentication mechanism. It contains the logon and logoff controllers, and…

mod_backup

mod_backup serves two different purposes: it makes a nightly backup of your files and database, and can also backup…

mod_base

mod_base is the base module, which acts as a container module holding most of Zotonic basic dispatch rules, Actions and…

mod_bootstrap

Adds support for the Twitter Bootstrap CSS / JavaScript framework. Integration module for Bootstrap assets and helper…

mod_clamav

Uses clamd to scan all uploaded files for viruses.

mod_comment

Implements a basic commenting system, enabling commenting on resources.

mod_contact

Implements a basic contact form, which gets emailed to the configuration value mod_contact.email , when submitted.

mod_content_groups

Module for content group support and ACL-aware content group behavior.