Text

All Text

after

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

urlize

Find urls in the given input and make them clickable.

truncate_html

Truncate a HTML text to a maximum length.

pickle

Pickle an Erlang value so that it can be safely submitted with a form.

urlencode

Make a text safe for URLs.

unescape

Removes HTML escaping from a text.

linebreaksbr

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

fix_ampersands

Replaces ampersands in the value with “&amp;” entities.

escapexml

Escape the value for insertion in xml output.

escape_link

Convert any URLs in a plaintext into HTML links, with adding the rel="nofollow" attribute, and replaces all newlines…

brlinebreaks

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

sha1

Translate a string to a sha1 hex value.

md5

Translates a string to a md5 hex value.

length

Returns the length of the value.

admin_dispatch

Dispatch rules Name Path Resource Args admin_user [“admin”,”users”] controller_admin [{template,”admin_users.tpl”}

mod_admin_predicate

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

dialog_predicate_new

Show a dialog for creating a new predicate.

dialog_user_add

Show a dialog for adding a user. This creates a person resource and adds a username / password to it.

without

Remove the items given in the argument from the filter value.

template

Render a template. When used in a postback action, the result will be sent back with the response data for the postback.

Templates

template

observe_media_upload_preprocess/2

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

Best Practices

Creating sites Media Best Practices Template Best Practices and Pitfalls

observe_media_upload_rsc_props/3

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

mod_facebook

The mod_facebook module plugs into the authentication system to enable Facebook login on your site.

facebook

Model for Facebook integration helpers, including auth-use flag, profile picture fetch, and Graph API proxy calls.

predicate

Retrieve information about predicates. Predicates are the labels on edges (connections between resources) that give…

embedded_media

Fetch media ids that are embedded in the body , body_extra and text blocks of your page.

without_embedded_media

Filter out media ids that are embedded in the body , body_extra and text blocks of your page.

Configuration

Global configuration Site configuration Port configurations

Resources

admin_merge_diff content_type_label content_type_urls summary temporary_rsc

mod_video

Adds support for viewing and handling video medium items.

mod_video_embed

This module, if activated, checks the pasted URLs in the create media / page dialog of the admin. It will show an embed…

controller_website_redirect

This controller does a redirect to the website property of the given resource.

controller_static_pages

Serve a static page or pages.

controller_signup_confirm

Controller which displays the confirmation page where the user can confirm his signup.

controller_signup

Controller which displays a form to sign up (rendered from signup.tpl ).

controller_redirect

Redirect to another url.

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_identity_types…

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.

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…

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”

observe_auth_precheck/2

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

escapejson

Escapes the value for safe insertion into JSON strings.

escapejs

Escapes the value for insertion in JavaScript output.

observe_auth_options_update/3

Update the given (accumulator) authentication options with the request options.

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]…

mod_oauth2

OAuth2 provider module for app/client/token management and authorization flows.

is_letsencrypt_valid_hostname

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

observe_survey_submit/2

A survey has been filled in and submitted.

validation_error

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