Documentation

All Documentation

debug

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

Debugging db (query) issues

Techniques for finding root cause when queries are involved.

default

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

default_if_none

Provide an alternative value in case a value is undefined.

default_if_undefined

Provide an alternative value in case a value is undefined.

delete_media

Delete a media file from a resource, without confirmation.

delete_rsc

Delete a resource, without confirmation.

delete_username

Delete the username from a user, no confirmation.

Deployment

So you have built your Zotonic site, and now you want to show it to the world. This page tells you how to configure…

Developer Guide

The technical handbook for developers building websites with Zotonic. It guides you through all aspects of the…

development

Model for development and diagnostics controls, including tracing flags, observer lists, cache/compile/reindex actions

development

Dispatch rules Name Path Resource Args admin_development [“admin”,”development”] controller_admin [{template

dialog

Opens a dialog with a predefined HTML content and title.

dialog_close

Closes a dialog. When there is no dialog open then nothing happens.

dialog_config_delete

Open a dialog that asks confirmation to delete a configuration key/value pair.

dialog_config_edit

Open a dialog to edit a configuration key/value pair.

dialog_config_new

Open a dialog to create a new configuration key/value pair.

dialog_delete_rsc

Open a dialog to confirm the deletion of a resource.

dialog_delete_username

Open a dialog to confirm the deletion of the username of a user.

dialog_duplicate_rsc

Open a dialog to duplicate the current resource with a new id and title.

dialog_edit_basics

Open a dialog to edit the “basic” information of a resource.

dialog_mailing_page

Shows the dialog to mail the current page ( resource) to a mailing list. This is used in the admin “mailing status”…

dialog_mail_page

Shows the dialog to mail the current page ( resource) to a single e-mail address. This is used in the frontend of a…

dialog_media_upload

Shows the admin dialog for uploading a media item. See Media.

dialog_new_rsc

Show the admin dialog for creating a new resource.

dialog_open

Renders a template on the server and opens a dialog with the HTML output of the template.

dialog_predicate_new

Show a dialog for creating a new predicate.

Dialogs

dialog dialog_open dialog_close overlay_open overlay_close

dialog_set_username_password

Show a dialog for setting a username / password on the given resource (which is usually a person).

dialog_user_add

Show a dialog for adding a user. This creates a person resource and adds a username / password to it.

Directory structure

Zotonic is a set of regular OTP applications. These can be found in the repository’s apps/ directory:

disable

Sets the “disabled” attribute of a HTML tag and adds the CSS class “disabled”.

dispatch

Dispatch rules Name Path Resource Args admin_category_sorter [“admin”,”category”] controller_admin_category_sorter…

dispatch

Dispatch rules Name Path Resource Args admin_statistics [“admin”,”statistics”] controller_admin_statistics []…

dispatch

Dispatch rules Name Path Resource Args acl_rule_test [“acl”,”rules”,”test”] controller_template [{template

dispatch

Dispatch rules Name Path Resource Args admin_frontend_edit [“edit”] controller_page [{acl,is_auth},{template

dispatch

Dispatch rules Name Path Resource Args contact [“contact”] controller_page [{template,”contact.tpl”},{id

dispatch

Dispatch rules Name Path Resource Args linkedin_authorize [“oauth-service”,”authorize”,”linkedin”]…

dispatch

Dispatch rules Name Path Resource Args logoff [“logoff”] controller_logoff [] logon [“logon”] controller_template…

dispatch

Dispatch rules Name Path Resource Args letsencrypt_challenge [“.well-known”,”acme-challenge”,token]…

dispatch

Dispatch rules Name Path Resource Args admin_filestore [“admin”,”filestore”] controller_admin [{template

dispatch

Dispatch rules Name Path Resource Args admin_auth2fa_config [“admin”,”authentication-2fa”] controller_admin [{ssl

dispatch

Dispatch rules Name Path Resource Args admin_l10n [“admin”,”localization”] controller_admin [{template,”admin_l10n.

dispatch

Dispatch rules Name Path Resource Args admin_comments [“admin”,”comments”] controller_admin_comments [seo_noindex]…

dispatch

Dispatch rules Name Path Resource Args admin_seo [“admin”,”seo”] controller_admin_seo [seo_noindex]…

dispatch

Dispatch rules Name Path Resource Args admin_predicate [“admin”,”predicate”] controller_admin [{acl_module

dispatch

Dispatch rules Name Path Resource Args admin_custom_redirect [“admin”,”custom-redirect”] controller_admin…

dispatch

Dispatch rules Name Path Resource Args admin_menu_hierarchy [“admin”,”hierarchy”,name] controller_admin [{template

dispatch

Dispatch rules Name Path Resource Args facebook_authorize [“oauth-service”,”authorize”,”facebook”]…

dispatch

Dispatch rules Name Path Resource Args admin_config [“admin”,”config”] controller_admin_config [seo_noindex]…

dispatch

Dispatch rules Name Path Resource Args microsoft_authorize [“oauth-service”,”authorize”,”microsoft”]…

dispatch

Dispatch rules Name Path Resource Args admin_log [“admin”,”log”] controller_admin [{template,”admin_log.tpl”}

dispatch

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

dispatch

Dispatch rules Name Path Resource Args signup [“signup”] controller_signup [] signup_confirm [“signup”,”confirm”]…

dispatch

Dispatch rules Name Path Resource Args admin_merge_rsc [“admin”,”merge”,id] controller_admin_edit [{template

dispatch

Dispatch rules Name Path Resource Args sitemap_xml [“sitemap.xml”] controller_template [{template,”sitemap.tpl”}

dispatch

Dispatch rules Name Path Resource Args admin_import [“admin”,”import”] controller_admin [{template,”_admin_import.

dispatch

Dispatch rules Name Path Resource Args fileuploader [“fileuploader”,”upload”,name] controller_fileuploader []…

dispatch

Dispatch rules Name Path Resource Args oauth2_consumer_authorize [“oauth-service”,”authorize”,”zotonic”

dispatch

Dispatch rules Name Path Resource Args zotonic_sites_add [“zotonic”,”sites”,”add”] controller_zotonic_status…

dispatch

Dispatch rules Name Path Resource Args admin [“admin”] controller_admin [seo_noindex] admin_overview_rsc [“admin”

dispatch

Dispatch or generate URLs or page paths. Useful to check dispatch rules or for client side code to dispatch page paths.

dispatch-cotonic

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

dispatch_export

Dispatch rules Name Path Resource Args export_rsc [“export”,”rsc”] controller_export_resource [] export_rsc…

dispatch_mailinglist

Dispatch rules Name Path Resource Args admin_mailinglist [“admin”,”mailinglists”] controller_admin_mailinglist…

dispatch_module_admin

Dispatch rules Name Path Resource Args admin_modules [“admin”,”modules”] controller_admin_module_manager…

Dispatch notifications

content_types_dispatch dispatch dispatch_host dispatch_rewrite page_url url_abs url_rewrite

Dispatch rules

Dispatch rules route incoming requests to controllers.

dispatch-test

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

dispatch_translation

Dispatch rules Name Path Resource Args admin_translation [“admin”,”translation”] controller_admin [{acl_module

Displaying a site map

For the benefit of search engines and fans of tables of contents you can easily provide a site map.

Docker

We offer the Docker image zotonic/zotonic-dev which contains build tools and Erlang.

DOM Elements

add_class animate buttonize effect fade_in fade_out hide insert_after insert_before insert_bottom insert_top…

Download Zotonic

Get the latest release Download the latest release of Zotonic from Github. Use git clone, so that you can easily…

draggable

Mark a html element as draggable.

droppable

Mark an element as valid drag destination.

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…

edge

Access information about page connections.

Edge notifications

edge_delete edge_insert edge_update

Editor

editor_add editor_remove zlink zmedia zmedia_choose zmedia_has_chosen

editor_add

Add WYSIWYG editor controls to all textarea’s with the z_editor class in the target.

editor_remove

Remove any WYSIWYG editor controls from all textarea’s with the z_editor class in the target.

editor_tinymce

Model exposing TinyMCE editor version metadata used by admin/editor integration.

effect

Add a $(..).effect jQuery call to the target element.

element

Select an element from a tuple or list of tuples.

email

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

email_dkim

DomainKeys Identified Mail Signatures (RFC 6376) is a method to add a signature to outgoing emails. This enables…

E-mail handling

Any Zotonic system is capable of sending and receiving e-mail messages over SMTP.

E-mail notifications

email_add_handler email_bounced email_dkim_options email_drop_handler email_ensure_handler email_failed…

email_receive_recipient

Model for received-email recipient extraction and matching used by mod_email_receive.

email_relay

Model for email relay API endpoints, handling relay delivery requests and relay status updates.

email_status

Tracks the send/bounce/error status of all outgoing emails.

email_unique

Check if an entered e-mail address is unique, by looking in the m_identity table for the email key:

embedded_media

Fetch media ids that are embedded in the body , body_extra and text blocks of your page.

enable

Resets the “disabled” attribute of a HTML tag and removes the CSS class “disabled”.

Enabling Growl Notifications

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

Encryption

md5 sha1

eq_day

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

Erlang tab completion

Get quicker access to Zotonic code on the shell.

escape

HTML escape a text. Escapes all reserved HTML characters in the value. Escaped strings are safe to be displayed in a…