mod_base

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

Note that the amount of templates has been kept to a minimum in this module, so that sites are free to implement whatever templates they want.

Edit on GitHub

Models

m_mqtt_ticket

A ticketing system for out of band MQTT posts via HTTP.

Controllers

controller_api

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

controller_file

Serve an uploaded-, resized- or library file.

controller_file_id

Redirect to the controller controller_file.

controller_http_error

This controller is called for serving http error pages.

controller_id

Handle different content representations of a page.

controller_mqtt_transport

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

controller_page

Show a rsc as a HTML page.

controller_ping

Simple controller for connection tests, used on the /test/connection page.

controller_redirect

Redirect to another url.

controller_static_pages

Serve a static page or pages.

controller_template

Show a template.

controller_website_redirect

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

Dispatch rules

dispatch

Dispatch rules Name Path Resource Args id [“id”,id] controller_id [] lib [“lib”,’*’] controller_file [{root

dispatch-cotonic

Dispatch rules Name Path Resource Args mqtt_transport [“mqtt-transport”] controller_mqtt_transport []…

dispatch-test

Dispatch rules Name Path Resource Args initial_test [“test”,”initial_postback_test”] controller_template…

Filters

add_day

Adds a day to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_hour

Adds an hour to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_month

Adds a month to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_week

Adds a week to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_year

Adds a year to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

after

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

append

Appends the argument to the value.

as_atom

Convert a value to an Erlang atom.

before

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

brlinebreaks

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

capfirst

Converts the first character of the value to uppercase.

center

Centers the value in a field of a certain width using spaces.

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…

date

Formats a date or datetime according to the format specified in the argument.

datediff

Calculate the difference between two dates, returning a single part of that difference.

date_range

Show a date range.

default

Provide an alternative value in case a value has a falsy value (0, false , undefined or empty string).

element

Select an element from a tuple or list of tuples.

Scomp

chart_pie

Show a pie chart.

chart_pie3d

Show a pie chart with 3D effect.

debug

Shows which variables are assigned for use in the current template’s scope:

google_chart

Make charts with Google.

inplace_textbox

Render a JS-aided inplace textbox.

lazy

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

loremipsum

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

pager

Show a pager for search results.

spinner

Add an AJAX activity indicator.

tabs

Make a HTML element into a tab set.

Validators

acceptance

Check if an input value evaluates to true.

confirmation

Check if two inputs are the same.

custom

Support for custom client-side (JavaScript-based) validators.

date

Validate input date against a given date format.

email

Check if the content of the input field is an e-mail address.

format

Regular expression test.

length

Check the length of a text input.

name_unique

A validator to check whether a resource’s name is unique:

numericality

Numerical input and range check.

postback

Performs a custom server side validation of an input value. This allows you to add your own validation logic to HTML…

presence

Check if an input has been filled in or checked.

See also

All dispatch rules

All the dispatch rules from all modules. For a background on dispatch rules, see The URL dispatch system.

mod_custom_redirect

Enables redirects from unknown hosts and paths to other locations. The other location can be a known path or another…

Dispatch rules

Dispatch rules route incoming requests to controllers.

Referred by

Enabling Growl Notifications

Using growl outside admin requires some magic to make it work.

mod_custom_redirect

Enables redirects from unknown hosts and paths to other locations. The other location can be a known path or another…

Controllers

Controllers are the Erlang modules which decide what happens when a browser requests a page. Zotonic looks at the…

All dispatch rules

All the dispatch rules from all modules. For a background on dispatch rules, see The URL dispatch system.

Dispatch rules

Dispatch rules route incoming requests to controllers.