Text
Dynamic select options using a wired template
Why Suppose you want to wire a change event for a select box to update a another select box, i.e. you want to wire the…
Performing additional, project-specific actions when a user signs up
Managing redirection after login and signup
Configure mod_signup to redirect to something other than a member’s home page.
Customizing the sign up and sign in form
You want to change parts of the form, or change its appearance.
Share variable binding across blocks
How to avoid having to call the same query inside several blocks of the same page
Retrieving the category of a page
Getting the category from a URL is somewhat involved, but not impossible. This is an example of what you can do with…
Page-specific dynamic backgrounds
Use edges ( page connections ) to associate backgrounds with pages.
Updating form field from a dialog
Ever wanted to update a form field from a dialog, possibly giving the user some list to choose from? Here’s how to do…
How to add a custom Content Block
Zotonic comes with a number of standard content blocks: Header, Text and Embed page. Additional content blocks are…
Implementing a simple contact form
This tutorial teaches you to create a form, validate it, submit it over Ajax and e-mail the results back to you.
Specific error pages Zotonic’s controller_http_error first tries to find an error page template that is specific for…
Logstash is often used for log centralization and analysis. This cookbook describes how to set up Zotonic for logging…
Zotonic provides a couple of ways to show icons in templates:
Execute tasks asynchronously using the task queue
The Zotonic task queue lets applications perform tasks asynchronously.
This chapter describes how to override the templates, styling and logic provided by Zotonic.
Implement a custom search by observing the search_query notification in your module. Imagine you want to search cookies…
Custom tags, internally called scomps , are module-defined tags, which are used when the logic is too complex to be…
In this chapter we will look at how to implement a model around the The Open Movie Database (OMDB) API.
Create custom template filters to change the way variables are rendered in your templates. By following some simple…
Admin cookbook Creating a custom widget on the edit page Customizing the layout of the admin edit page Customizing the…
Trigger various jQuery effects on the target element. Mostly, each of these effects have their own action as a shortcut
Not yet documented.
Removes all HTML tags from the value.
Handle different content representations of a page.
Filters a list on the value of a property, either on presence or equality.
is_not_a mirrors is_a. It is particularly useful when iterating over a category and excluding members of a sub-category…
Filter a list of resource ids on category, or test if a single resource id belongs to a category.
Filter a list of resource ids so that only the visible ids remain.
Pretty print a zotonic value in a template.
Welcome to Zotonic 0.37.0, released on 5 March, 2018.
Regular expression replacement of a pattern with a string.
Match a value with a regular expression.
match replace
Redirect to the controller controller_file.
Serve an uploaded-, resized- or library file.
Welcome to Zotonic 0.57.0, released on May 11, 2020.
Some interesting tidbits about saving/updating a date/time field of a resource.
Any Zotonic system is capable of sending and receiving e-mail messages over SMTP.
Force the given value in the given range.
Take the minimum of the filter value and its first argument.
Take the maximum of the filter value and its first argument.
Fetch the url of a resource’s html representation
The zotonic command runs a number of utility commands which all operate on a Zotonic instance.
It is possible to create end-to-end integration tests for Zotonic websites. Tests like these are called sitetests .
Test if a value is a number (integer or floating point):
Get quicker access to Zotonic code on the shell.
The main admin edit controller. This controller serves the edit page where resources can be edited.
controller_admin_media_preview
A controller for rendering preview thumbnails of any media embedded in a richtext-editor component of a resource on the…
Dispatch rules route incoming requests to controllers.
Controllers are the Erlang modules which decide what happens when a browser requests a page. Zotonic looks at the…
Wires are the older way to code actions and client/server interaction. It is now advised to use MQTT topics with…
Applying Erlang Binary syntax to get fast character manipulation.
Show a template.
Access control is about defining who is allowed to access certain resources. It takes two steps:
Adds basic search engine optimization to the base templates and provides an admin interface for configuring SEO options…
Show a rsc as a HTML page.
Try to identify a file, returning a map with file properties.
Sets the “disabled” attribute of a HTML tag and adds the CSS class “disabled”.
Resets the “disabled” attribute of a HTML tag and removes the CSS class “disabled”.
Zotonic runs on Linux, Mac OS X and (not officially) on Windows.
Installation Zotonic won’t start and shows errors when running zotonic debug Check your site’s database configuration.
The Zotonic “status” site is the first thing you see once you have installed Zotonic, or if you do not have any sites…
Zotonic has the capability of serving more than one site at a time. You can have multiple sites enabled, each with its…
You have three options for running Zotonic: to get started quickly, start our Zotonic container. You can also use Nix…
Toggle a CSS class from an HTML element.
Add a css class to an html element.
Remove a CSS class from an HTML element.
Not yet documented.
mod_backup serves two different purposes: it makes a nightly backup of your files and database, and can also backup…
Email status notification, sent when the validity of an email recipient changes
Foldr to change or add pivot fields for the main pivot table. The rsc contains all rsc properties for this resource
Hide an element by animating the height and opacity.
Show an element by animating the height and opacity.
Hide an element by animating the height.
Show an element by animating the height.
Hide an element by animating the opacity.
Hide an element without any animation.
Show an element without any animation.
Toggle the visibility of an element.
Show an element by animating the opacity.
Translates a datetime from local time to UTC.
Show a readable version of a date/time difference.
Subtracts a year from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Subtracts a week from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Subtracts a month from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Subtracts a day from a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Tests if two dates are not equal.
Tests if a date is in the past.
Tests if a date is in the future.
Tests if the value is a date and equal to the argument. The value and the argument must be a tuple of the format {Y,M
Calculate the difference between two dates, returning a single part of that difference.
Show a date range.
Adds a year to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a week to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a month to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a day to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
add_hour add_day add_month add_week add_year date date_range datediff eq_day in_future in_past ne_day sub_hour sub_day…
Extract a summary from a resource.