Text

All Text

controller_mqtt_transport

Controller for transport of MQTT data between the browser (client) and server.

controller_mailinglist_export

Controller which downloads the given mailinglist id as a CSV file.

controller_logoff

Controller that logs off a user, destroying the session. It also removes any “remember me” cookies the user has, so…

controller_language_set

Controller which sets the language as given in the code argument, and redirects the user back to the page given in the…

controller_http_error

This controller is called for serving http error pages.

controller_api

controler_api processes authorized REST API requests: It provides an easy way to create API calls to allow computer…

controller_admin_seo

Shows a form with settings related to Search Engine Optimization.

controller_admin_referrers

Shows the list of pages ( resources) which refer to this resource through an edge.

controller_admin_module_manager

Shows the list of Zotonic modules currently known to the system.

controller_admin_mailinglist_recipients

Shows the recipients of the current mailing list. The recipients are listed in three columns, and have a checkbox next…

controller_admin_mailinglist

This controller shows the mailing lists that are available in the system.

controller_admin_mailing_status

This controller shows the mailing status of a resource. It lists each mailing list available in the system, and shows…

controller_admin_config

Shows the admin config editor. Here you can edit the key/value pairs of m_config.

controller_admin_comments_settings

Shows an admin settings screen where you can edit settings related to mod_comment.

controller_admin_comments

Shows an admin screen with an overview of most recently created comments. The screen offers the option to moderate the…

controller_admin_backup_revision

Shows the admin backup revisions screen where you can see older version for a resource.

controller_admin_backup

Shows the admin backup screen where you can download nightly backups that were made by mod_backup.

controller_hello_world

Simple controller that always serves the string Hello, World!

Template Best Practices and Pitfalls

This chapter lists some preferred solutions to common tasks and pitfalls you may encounter while developing with…

force_escape

HTML escapes a text.

mod_logging

Logs messages to the database and adds log views to the admin.

dispatch

Dispatch rules Name Path Resource Args admin_log [“admin”,”log”] controller_admin [{template,”admin_log.tpl”}

Authentication notifications

auth_checked auth_confirm auth_confirm_done auth_client_logon_user auth_client_switch_user auth_logon auth_logoff…

controller_authentication

This controller manages all authentication cookies. It is called by the auth model in the browser.

Media Best Practices

Use Media classes to define image properties.

dispatch

Dispatch rules Name Path Resource Args admin_category_sorter [“admin”,”category”] controller_admin_category_sorter…

admin_tasks

Action module which provides postback handlers for the “status” view of the admin:

Admin

admin_tasks redirect_incat

if

Selects an argument depending on a condition.

is_undefined

Tests if a value is undefined.

is_defined

Tests if a value is defined.

if_undefined

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

exclude

Filters a list on the value of a property, either on absence or inequality.

m_search

The m_search model provides access to different kinds of search queries for searching through models.

chunk

This filter splits a list in shorter lists. It splits an array in sub-arrays of at most a given length. This is useful…

mod_admin_category

Add support for editing Categories in the admin, by presenting an editable category tree at http://yoursite.com/admin…

controller_admin_category_sorter

Shows the admin category screen where you can edit the category tree, rearranging the categories, adding new categories

Global template variables

These variables are always available for rendering in templates.

dispatch

Dispatch rules Name Path Resource Args admin [“admin”] controller_admin [seo_noindex] admin_overview_rsc [“admin”

auth_precheck

First for logon of user with username, check for ratelimit, blocks etc.

escapejson

Escapes the value for insertion in JSON output.

escapejs

Escapes the value for insertion in JavaScript output.

auth_options_update

Update the given (accumulator) authentication options with the request options. Note that the request options are from…

dialog_new_rsc

Show the admin dialog for creating a new resource.

slugify

Converts a text into a slug.

dispatch

Dispatch rules Name Path Resource Args admin_seo [“admin”,”seo”] controller_admin_seo [seo_noindex]…

is_letsencrypt_valid_hostname

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

survey_submit

A survey has been filled in and submitted.

validation_error

Render a validation error on the target. Text is given in the text argument.

m_mailinglist

Not yet documented.

replace_args

Replace $N placeholders in string from a list of replacement values.

dispatch_module_admin

Dispatch rules Name Path Resource Args admin_modules [“admin”,”modules”] controller_admin_module_manager…

postback_notify

Handle a javascript notification from the postback handler. The message is the the request, trigger the id of the…

mod_admin_frontend

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

dispatch

Dispatch rules Name Path Resource Args admin_frontend_edit [“edit”] controller_page [{acl,is_auth},{template

slice

Perform array-slice operations on a list or string.

CMS

Zotonic is a Content Management System (CMS).

dispatch

Dispatch rules Name Path Resource Args admin_auth2fa_config [“admin”,”authentication-2fa”] controller_admin [{ssl

dispatch_host

Try to find the site for the request Called when the request Host doesn’t match any active site.

email_failed

Notify that we could NOT send an e-mail (there might be a bounce later…) The Context is the depickled z_email:send/2…

with_args

Apply actions with arguments added.

Actions

with_args

set_value

Set the value of a form field.

mod_cron

Provides periodic events.

yesno

Show a boolean value as a text.

slide_toggle

Toggle an element by sliding it up and down.

sanitize_embed_url

Sanitize an embed url. The hostpart is of the format: <<"youtube.com/v...">> .

Resource lists

group_firstchar group_title_firstchar is_a is_not_a is_visible media_for_language

media_identify_extension

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

reversed

Reverse a list.

multiupload

Handle an uploaded file which is part of a multiple file upload from a user-agent. The upload is a #upload record or a…

m_admin_status

Not yet documented.

rsc_get

Resource is read, opportunity to add computed fields Used in a foldr with the read properties as accumulator.

script

This action executes JavaScript directly. It can be used to interface with non-Zotonic JavaScript libraries and…

output_html

Fold for mapping non-iolist output to iolist values. Used when outputting a rendered HTML tree. Folded accumulator is:…

rsc_insert

Foldr for an resource insert, these are the initial properties and will overrule the properties in the insert request.

m_acl

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

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.

dialog_mailing_page

Shows the dialog to mail the current page ( resource) to a mailing list. This is used in the admin “mailing status”…

dialog_mail_page

Shows the dialog to mail the current page ( resource) to a single e-mail address. This is used in the frontend of a…

Mailing list

dialog_mail_page dialog_mailing_page mailing_page_test mailinglist_confirm mailinglist_unsubscribe

mod_contact

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

Proxying Zotonic with nginx

It is possible to put Zotonic behind the nginx <http://nginx.org/> web server, for example if you have other, non

Running on Port 80 and Port 443

Using standard ports helps visitors discover your page and removes the awkward port number from URLs.

m_acl_user_group

Not yet documented.

delete_rsc

Delete a resource, without confirmation.