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

Read and update resource properties

Use model#rsc for resource access and m_rsc_update for writes. These APIs handle behavior that a direct SQL update would bypass.

Developer guide

Recompile code and refresh discovery

Use compilation for changed Erlang source, loading for changed BEAM files, and an index refresh when new templates or application files are not discovered.

Developer guide

Render and manage media

Use resource IDs, media metadata and consistent responsive-image descriptors.

Developer guide

Respond to a notification

Find the notification definition and inspect its callers before implementing an observer. The notifier operation determines whether observers collect results

Developer guide

Run tests and site checks

Use the project's test workflow in a dedicated development or test environment. Two CLI entry points have different scopes:

Developer guide

Run work outside a request

Use an existing Zotonic task mechanism when it fits the job. Use a supervised worker when the work needs a persistent process with its own lifecycle.

Developer guide

Search

Query arguments and terms for searching pages using the search APIs.

Developer guide

Site configuration and enabled modules

A site is identified by its application and priv/zotonic_site configuration. Supported formats include Erlang .config, JSON, and YAML; follow the format…

Developer guide

Test Erlang behavior with focused examples

Keep domain logic in small functions that accept explicit inputs. Test expected results, boundary values, and meaningful error cases without starting a full…

Developer guide

Test the database connection

Run bin/zotonic connectdb to test a connection using the global Zotonic database configuration. It does not open PostgreSQL’s interactive client and has no…

Developer guide

Test with different users

Choose roles that exercise the operation's permission boundary: anonymous visitor, limited editor, and administrator. Use separate browser sessions or an…

Developer guide

The Zotonic workspace

The checkout is an Erlang umbrella project: one build contains many applications.

Developer guide

Trace a small number of Erlang calls

Open the Development function tracing tool as the admin user. Enter a module, optionally a function, and a small limit on the number of calls.

Developer guide

Trace a URL through dispatch

Open the Development page's dispatch tools. Inspect the list of active rules, then trace the path that produces an unexpected result.

Developer guide

Trace database queries for your session

Enable module#mod_server_storage if the Development page says it is needed for database tracing. On the Development page, enable Trace all database queries for…

Developer guide

Trace templates rendered by a request

Open the Development page's Live dependency graph of templates tool. Start a trace for your session, then load the page or path you want to inspect.

Developer guide

Translate interface text

Write the source text in English and mark static interface text for translation.

Developer guide

Understand the optional development API

The Development page has an option to enable an API for recompiling and rebuilding Zotonic. The model implements actions for recompiling, flushing caches, and…

Developer guide

Update dependencies deliberately

Change a dependency when you can identify the required fix or feature and the affected callers. Read its version constraints and inspect the resulting lockfile…

Developer guide

Upgrade a module's data schema

Version schema changes through the module's installation and upgrade mechanism. Inspect a module using -mod_schema and manage_schema/2 before adding your own…

Developer guide

Use Cotonic and MQTT for browser messaging

Use the existing Cotonic browser models and Zotonic MQTT bridge when components need to communicate through topics. First identify whether the topic stays…

Developer guide

Use stable resource names

A resource has a numeric ID within its database. Give application-owned resources a stable name when code needs to find them across installations.

Developer guide

Use stable resource names

A resource has a numeric ID within its database. Give application-owned resources a stable name when code needs to find them across installations.

Developer guide

Validate a form on both sides

Use semantic form controls with labels and meaningful names. Add Zotonic validators for immediate feedback, then validate the submitted values again at the…

Developer guide

Verify an upgrade before release

Prepare an isolated copy of the previously released application and database. Add representative edited content, then apply the new code and schema changes.

Developer guide

Verify backups by restoring them

Define what must be recovered: database, original media, configuration, and security material. Check which parts the selected backup includes before depending…

Developer guide

Work with a site context

A context carries the site and request-related state used by Zotonic APIs. Pass it through your functions instead of storing one context globally.

Developer guide

Work with uploaded media

A media resource has ordinary content properties and information about its associated file. Use model#media to inspect and manipulate media through Zotonic's…

Developer guide

Write logs that explain an operation

Log the operation and its result with structured fields. Include an identifier that helps connect the message to a resource or job, without logging credentials…