Browse by topic

Discover Documentation

Explore related documentation through its most useful keyword groups.

1031 items

Grouped by Architecture

All Documentation

Reference

Global configuration

This section describes the location and contents of Zotonic’s global configuration files erlang.config and zotonic.config . There’s also site-specific…

Documentation

Glossary

Action An action is functionality that can be attached to a HTML element or event. Actions are wired to an element or event. Think of showing dialogs, posting…

Filters

gravatar_code

Calculate the gravatar code for an e-mail address:

Filters

group_by

Groups items of a list by a property.

Filters

group_firstchar

Group a list of sorted model#rsc resource IDs on their first letter of the title or another resource property. After grouping, it splits this list in a number…

Filters

group_title_firstchar

Similar to filter#group_firstchar, but always uses the title column from the rsc table.

Actions

growl

Show a message in the upper right corner of the browser window. The message will automatically disappear after some time.

Validators

hasedge

A validator to check if a resource has a certain number of edges with a predicate.

Actions

hide

Hide an element without any animation.

Models

hierarchy

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

Cookbook

How to add a custom page block

Zotonic comes with a number of standard page blocks: Header, Text and Embed page. Additional page blocks are provided by modules, for example mod_survey uses…

Cookbook

How to customise error pages

Specific error pages Zotonic’s controller_http_error first tries to find an error page template that is specific for the HTTP status code, named templates…

Developer guide

HTTPS support

Zotonic has built-in support for HTTPS and TLS (previously SSL) certificate handling.

Developer guide

Icons

Including Zotonic icons CSS Add the CSS file to your template:

Cookbook

Icons in templates

Zotonic provides a couple of ways to show icons in templates:

Models

identity

The m_identity model manages usernames and other user identities. module#mod_authentication uses it to store and check salted passwords, but also provides a…

Filters

if

Selects an argument depending on a condition.

Tags

if

Show something if the condition is true.

Tags

ifchanged

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

Tags

ifequal

Show something if two values are equal.

Tags

ifnotequal

Show something if two values are not equal.

Filters

if_undefined

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

Tags

image

Show a still image using an <img\> element. The image will be automatically resized to the desired size and filters. For video, use the tag#media tag instead.

Models

image_edit

Manages the medium_edit_settings property for non destructive image editing.

Tags

image_url

Generate the url of a still image.

Models

import_csv_data

Model to track resources imported from CSV and XLSX files.

Tags

include

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

Filters

index_of

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

Filters

in_future

Tests if a date is in the future.

Tags

inherit

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

Filters

in_past

Tests if a date is in the past.

Filters

insert

Prepends the argument in front of the value.

Actions

insert_after

Insert rendered HTML immediately after the target element.

Actions

insert_before

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

Actions

insert_bottom

Inserts HTML after the contents of an HTML element.

Actions

insert_top

Inserts HTML before the contents of an HTML element.

Developer guide

Introduction

This is the Zotonic Developer Guide. It takes you through all aspects of Zotonic so you can start building your own sites as quickly as possible.

Filters

ip2country

Return the lowercase ISO country code associated with an IP address.

Filters

ip2geo

Return geographic information associated with an IP address.

Filters

is_a

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

Filters

is_even

Test if an integer value is even:

Filters

is_list

Test if a value is a list:

Filters

is_not_a

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

Filters

is_number

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

Filters

is_rtl

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

Filters

is_site_url

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

User guide

Issues and features

If you encounter any issues in using Zotonic, or have ideas for new features, please let us know at the Zotonic issue tracker. You need to have a free GitHub…

Filters

is_user

Test if a resource is a user.

Filters

is_valid_email

Test whether a value has valid email-address syntax.

Filters

is_visible

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

Tags

javascript

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

Filters

join

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

Actions

jquery_effect

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

Validators

json

Validate that a form value is JSON.

Models

l10n

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

Filters

language

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

Filters

language_dir

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

Filters

language_sort

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

Filters

language_sort_localized

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

Filters

last

Returns the last character or element.

Scomp

lazy

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

Validators

length

Check the length of a text input.

Filters

length

Returns the length of the value.

Tags

lib

Combine css and javascript includes in a single request.

Filters

linebreaksbr

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

Actions

link

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

Models

linkedin

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

Scomp

live

Live-updating templates driven by MQTT topics.

Filters

ljust

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

Tags

load

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

Models

log

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

Models

log_csp

Model for admin Content-Security Report log retrieval by index, gated by admin permissions.

Models

log_email

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

Filters

log_format_stack

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

Developer guide

Logging

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

Cookbook

Logging to Logstash

Logstash is often used for log centralization and analysis. This cookbook describes how to set up Zotonic for logging to Logstash over UDP. As mentioned in the…

Actions

logoff

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

Models

log_ui

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

Scomp

loremipsum

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

Filters

lower

Translates the value to lower case.

Models

mailinglist

Model for mailinglist operations and reporting, including recipient counts, delivery stats, subscriptions, and scheduled mailings.

Actions

mailinglist_confirm

Confirm a mailinglist subscription. Required argument is the confirm_key .

Models

mailinglist_run

Durable mailing runs and delivery accounting, available as m.mailinglist_run in templates. Recipient addresses and message diagnostics are never published on…

Scomp

mailinglist_subscribe

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

Actions

mailinglist_unsubscribe

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