Browse by topic

Discover Developer guide

Explore related documentation through its most useful keyword groups.

166 items

Grouped by Domain

All Developer guide

Developer guide

Add a filter or rendering component

Use a filter for a small transformation of an input value. Keep missing and unexpected values predictable, and escape output at the point where it becomes HTML.

Developer guide

Add an HTTP controller

Use controller_template when a dispatch rule only needs to render a template. Write a custom controller when the endpoint needs additional request processing…

Developer guide

A model returns an error or no value

Check the requested path and compare its binary segments with the model callback patterns. Confirm that the callback returns the unused path in the required…

Developer guide

A module is discovered but not active

Open module management for the correct site. Check whether the module is disabled, waiting for a dependency, or failing during startup.

Developer guide

A module is missing from the admin

Check that the module is an Erlang application in a discovered project directory. Confirm the application name, .app.src, main mod_... module, and successful…

Developer guide

Anatomy of a site application

A typical site contains the following directories. Create only the extension directories you actually need.

Developer guide

An uploaded image does not display

Check whether the resource has an original file and whether its media information describes that file correctly. Then inspect the preview request in the…

Developer guide

A page is slow

Measure one representative request and identify whether time is spent in the browser, network, or server. Compare an initial request with a repeated request to…

Developer guide

A saved change does not appear

Check each stage in order: the edited file, build output, loaded application, active module, selected template, and browser response.

Developer guide

A site does not start

Run bin/zotonic status to distinguish an unavailable node from a stopped or failing site. Inspect the relevant startup log before repeatedly restarting it.

Developer guide

A site does not start

Run bin/zotonic status to distinguish an unavailable node from a stopped or failing site. Inspect the relevant startup log before repeatedly restarting it.

Developer guide

A URL reaches the wrong page

Confirm the hostname, site, and path from the actual request. Use the dispatch trace to see the selected rule and any rewritten path.

Developer guide

Automatic recompilation and file watching

Zotonic's file handler watches source changes when a supported watcher is available. Erlang, templates, dispatch files, and assets have different handlers.

Developer guide

Build and serve frontend assets

Keep source files such as SCSS in priv/lib-src and compiled assets in priv/lib. Use an app-level Makefile that delegates asset work to the source directory's…

Developer guide

Build and serve frontend assets

Keep source files such as SCSS in priv/lib-src and compiled assets in priv/lib. Use an app-level Makefile that delegates asset work to the source directory's…

Developer guide

Build and start Zotonic

Compile Zotonic, start it, check the status page, and continue to your first site.

Developer guide

Cache a template fragment

First measure the work performed by the fragment. Cache a fragment only when you know which inputs and data changes affect its output.

Developer guide

Change a runtime setting deliberately

Use bin/zotonic setconfig only for a global setting that supports a runtime change. The command changes the running configuration and does not save the value…

Developer guide

Check a rendered template

Render the changed page with realistic content. Include missing optional fields, a long title, several list items, and a second language when applicable.

Developer guide

Check template references

Open Cross-reference check of templates in the Development page and run the check. Read each reported reference with the active module set in mind.

Developer guide

Configure persistent file storage

Identify where the site's archive files, generated previews, backups, and security files are stored. These have different retention and recovery needs.

Developer guide

Connect resources and preserve order

An edge connects a subject resource to an object resource through a predicate. Use model#edge to inspect and manage these connections.

Developer guide

Create a page layout

Use an existing site base template as your starting point. Put shared document structure in the base and page-specific markup in blocks.

Developer guide

Create a page layout

Use an existing site base template as your starting point. Put shared document structure in the base and page-specific markup in blocks.

Developer guide

Create a reusable module

Create apps_user/zotonic_mod_garden with the following files. This example adds a discoverable module without starting an extra process.

Developer guide

Create your first site

Create the garden blog, open it in your browser, and sign in to its admin.

Developer guide

Create your first site

Create the garden blog, open it in your browser, and sign in to its admin.

Developer guide

Create your first site

Create the garden blog, open it in your browser, and sign in to its admin.

Developer guide

CSS classes used in templates

If you are building a website then you might want to use the standard dialogs, overlays, authentication and other parts of Zotonic. To make those look like…

Developer guide

Deploy a repeatable release

Record the code revision, build steps, configuration changes, and schema changes for the release. Build and test the same revision in an acceptance environment…

Developer guide

Developer guide

Build, inspect, and maintain Zotonic sites and modules.

Developer guide

Diagnose a failed browser interaction

Reproduce one action with the browser console and network panel open. Check for a JavaScript error before the request, a failed request, or a successful…

Developer guide

Display images with mediaclasses

Define reusable image sizes in priv/templates/mediaclass.config and use them in image tags. For example, a local mediaclass can constrain an image's width:

Developer guide

Display images with mediaclasses

Define reusable image sizes in priv/templates/mediaclass.config and use them in image tags. For example, a local mediaclass can constrain an image's width:

Developer guide

Enable the Development module

Sign in to the local site's admin as an administrator. Open the module management page, find Development (mod_development), and activate it if necessary.

Developer guide

Expose an operation through an API

Start from the site's existing model API or controller patterns. Specify the method, input fields, response shape, and errors before connecting a browser or…

Developer guide

Expose data through a model

Create src/models/m_garden.erl in the Garden module. This complete example exposes a public greeting:

Developer guide

Find registered observers

Open Show an overview of all observers from the Development page. Find the notification and inspect the registered callbacks and their order.

Developer guide

Find the configuration layer to change

Distinguish global Zotonic configuration, Erlang runtime configuration, site configuration files, and module settings stored for a site. Similar setting names…

Developer guide

Find the status site and your site's admin

The status site manages the running Zotonic installation. A site's /admin manages that site's content and enabled modules. They have different scopes and can…

Find the status site and your site's admin

Developer guide

Find the template used by a page

Enable module#mod_development and open its template tools in the admin. Search for the template name and inspect the selected file and alternatives.

Developer guide

Follow a request to its template

Start with the URL that gives an unexpected result. Check its hostname: Zotonic uses it to select a site before matching the site's dispatch rules.

Developer guide

Follow a request to its template

Start with the URL that gives an unexpected result. Check its hostname: Zotonic uses it to select a site before matching the site's dispatch rules.

Developer guide

Get Zotonic

Choose a release or a development checkout and follow the installation guide.

Get Zotonic

Developer guide

Handle a browser event with a wire

Use scomp#wire to connect a browser event to an action or a server postback. Give the target element a stable ID within the rendered page.

Developer guide

Handle a browser event with a wire

Use scomp#wire to connect a browser event to an action or a server postback. Give the target element a stable ID within the rendered page.

Developer guide

Inspect logs and running processes

Use bin/zotonic logtail for the configured console log, or select error or crash when those files are available. The command prints the last 500 lines and…

Developer guide

Inspect template dependencies

Open Dependency graph of all available templates from the Development page. Use the graph to understand inheritance and include relationships before changing a…

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.

Developer guide

Keep permission checks at the boundary

Use the request context when checking access to data and actions. A hidden button is not an authorization check: callers can invoke a model or endpoint…

Developer guide

Model content with categories and predicates

Use a category to describe what a resource is, such as an article or event. Use a predicate to describe a relationship between two resources, such as an author…

Developer guide

Move content between sites

Export structured resource data and record how source resources map to destination resources. Match stable names or URIs deliberately; do not assume that…