Documentation

All Documentation

language

Notify that the session’s language has been changed

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 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.

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.

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_status

Not yet documented.

Mailing list

inject_recipientdetails

Mailing list

dialog_mail_page dialog_mailing_page mailing_page_test mailinglist_confirm mailinglist_unsubscribe

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 an e-mail address or a resource id.

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.

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.

m_client_local_storage

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

m_client_session_storage

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

m_comment

Accesses comments on a page.

m_config

Zotonic has two places where a site’s configuration is kept:

m_config_update

Site configuration parameter was changed

m_config_update_prop

Site configuration parameter was changed

m_content_group

Not yet documented.

m_custom_redirect

Not yet documented.

md5

Translates a string to a md5 hex value.

m_development

Not yet documented.

m_edge

Access information about page connections.

Media

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

media

Show embed, video or audio media.

Media Best Practices

Use Media classes to define image properties.

media_identify_extension

Try to find a filename extension for a mime type (example: “.jpg”)

media_identify_file

Try to identify a file, returning a map with file properties.

media_import

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

media_import_medium

Notification to import a medium record from external source. This is called for non-file medium records, for example…

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…

media_preview_options

Modify the options for an image preview url or tag. This is called for every image url generation, except if the…

media_replace_file

Notification that a medium file has been changed (notify) The id is the resource id, medium contains the medium’s…

media_stillimage

See if there is a ‘still’ image preview of a media item. (eg posterframe of a movie) Return:: {ok, ResourceId} or…

media_update_done

Media update done notification. action is ‘insert’, ‘update’ or ‘delete’

media_upload_preprocess

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

media_upload_props

Notification that a medium file has been uploaded. This is the moment to change properties, modify the file etc. The…

media_upload_rsc_props

Notification that a medium file has been uploaded. This is the moment to change resource properties, modify the file…

media_viewer

Request to generate a HTML media viewer for a resource

m_editor_tinymce

Not yet documented.

m_email_dkim

DomainKeys Identified Mail Signatures (RFC 6376) is a method to add a signature to outgoing emails. This enables…

m_email_receive_recipient

Not yet documented.

m_email_status

Tracks the send/bounce/error status of all outgoing emails.

member

Finds a value in a list.

Menu

menu_flat 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_is_visible

Filters a list of menu items on visibility. The is_visible filter can’t be used due to the structure of a menu item…

menu_rsc

Fetch the menu id belonging to a certain resource

menu_save

Save the menu tree of a menu 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.

m_facebook

Not yet documented.

m_filestore

The filestore uses two tables for its administration.

m_fileuploader

Model to start uploads, upload a block and delete uploads.

m_hierarchy

The category hierarchy tables have been replaced by m_hierarchy . This model defines named hierarchies of resources…