Text

All Text

dispatch

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

auth_confirm_done

A user id has been confirmed.

m_req

This model gives access to the request variables from within a template.

m_hierarchy

The category hierarchy tables have been replaced by m_hierarchy . This model defines named hierarchies of resources…

zlink

Used for inserting an internal link in the TinyMCE editor in the admin.

m_editor_tinymce

Not yet documented.

logoff

This action logs off the current user and reloads the current page as the anonymous visitor.

User

auth_disconnect delete_username dialog_delete_username dialog_set_username_password dialog_user_add logoff…

custom_pivot

Add custom pivot fields to a resource’s search index (map) Result is a single tuple or list of tuples {pivotname

m_server_storage

Model to access the server side storage of data.

Other notifications

action_event_type activity activity_send admin_edit_blocks admin_menu admin_rscform category_hierarchy_save…

Pivot notifications

pivot_fields pivot_rsc_data pivot_update custom_pivot

Media notifications

media_identify_extension media_identify_file media_import media_import_medium media_preview_options media_import_props…

E-mail notifications

email_add_handler email_bounced email_dkim_options email_drop_handler email_ensure_handler email_failed…

Edge notifications

edge_delete edge_insert edge_update

mod_email_relay

Enables the Zotonic site to relay emails for the site’s users to their real email addresses.

mod_email_receive

Enables the Zotonic site to receive emails for the site’s users. The user’s email address is username@hostname , where…

The addsite command

Adding a site to Zotonic is done through the zotonic shell command. It syntax is like this:

m_admin_menu

This model holds the admin menu, which is built up by calling each module to add items to the menu.

m_config_update_prop

Site configuration parameter was changed

m_client_session_storage

Model to access the sessionStorage on the client (browser).

module_rescan

Rescans all modules, to find all templates, lib files, dispatch rules, etc. again.

Modules (Admin)

module_rescan module_toggle

editor_add

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

menu_rsc

Fetch the menu id belonging to a certain resource

auth_checked

Fold over the context after logon of user with username, communicates valid or invalid password

dialog_set_username_password

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

dispatch

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

delete_username

Delete the username from a user, no confirmation.

m_admin_blocks

Not yet documented.

dialog_delete_username

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

backup

Dispatch rules Name Path Resource Args admin_backup [“admin”,”backup”] controller_admin_backup [seo_noindex]…

m_seo

Not yet documented.

debug

Push some information to the debug page in the user-agent. Will be displayed with io_lib:format(“~p: ~p~n”, [What, Arg]…

zmedia_has_chosen

Used by the admin as a callback when a media file has been selected for insertion into the rich-text editor.

hierarchy_updated

Signal that the hierarchy underneath a resource has been changed by mod_menu

category_hierarchy_save

Save (and update) the complete category hierarchy

m_comment

Accesses comments on a page.

m_translation

The m_translation model gives easy access to language and translation related information.

mod_search

mod_search implements various ways of searching through the main resource table using m_search.

dialog_media_upload

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

dialog_edit_basics

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

dialog_delete_rsc

Open a dialog to confirm the deletion of a resource.

delete_media

Delete a media file from a resource, without confirmation.

Resources

delete_media delete_rsc dialog_delete_rsc dialog_duplicate_rsc dialog_edit_basics dialog_media_upload dialog_new_rsc…

pivot_rsc_data

Fold over the resource props map to extend/remove data to be pivoted

rsc_upload

Upload and replace the resource with the given data. The data is in the given format.

rsc_update

An updated resource is about to be persisted. Observe this notification to change the resource properties before they…

rsc_query_item

Send a notification that the resource ‘id’ is added to the query query_id.

rsc_delete

Resource will be deleted. This notification is part of the delete transaction, it’s purpose is to clean up associated…

Resource notifications

rsc_delete rsc_get rsc_import_fetch rsc_insert rsc_merge rsc_pivot_done rsc_query_item rsc_update rsc_update_done…

overlay_close

Closes the currently open overlay. When there is no overlay open then nothing happens.

Dialogs

dialog dialog_open dialog_close overlay_open overlay_close

m_modules

Access information about which modules are installed and which ones are active.

User management

Create new users In the admin, under ‘Auth’ > ‘Users’ you can find a list of all users. Use the ‘Make a new user’…

auth_logoff

User is about to log off. Modify (if needed) the logoff request context.

update_iframe

Updates the content of an iframe with a template or a literal HTML text.

set_class

Set the class of an element.

effect

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

DOM Elements

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

m_ratelimit

Not yet documented.

dropbox_file

Handle a new file received in the ‘files/dropbox’ folder of a site. Unhandled files are deleted after a hour.

sanitize_element

Sanitize an HTML element.

mod_media_exif

When uploading a file, this module extracts properties from the uploaded media and sets them in the resource.

submit

Submits the enclosing form, a specifically targeted form or the closest form to an element.

reset

Resets the enclosing form, a specifically targeted form or the closest form to an element.

form_reset

Resets the target form to its initial state.

event

Bind actions to a jQuery event or submit a form.

Forms

disable enable event focus form_reset reset set_value submit typeselect validation_error

m_log_ui

Not yet documented.

moreresults

Show more results of the current search query inline on the page.

Search

moreresults

m_oauth2

Not yet documented.

m_acl_rule

Not yet documented.

email_add_handler

Add a handler for receiving e-mail notifications

email_received

Notification sent to a site when e-mail for that site is received

Issues and features

If you encounter any issues in using Zotonic, or have ideas for new features, please let us know at the Zotonic issue…

url_rewrite

Rewrite a URL after it has been generated using the z_dispatcher

dispatch_rewrite

Rewrite a URL before it will be dispatched using the z_sites_dispatcher

Dispatch notifications

content_types_dispatch dispatch dispatch_host dispatch_rewrite page_url url_abs url_rewrite

content_types_dispatch

Get available content types and their dispatch rules Example: {“text/html”, page} A special dispatch rule is ‘page_url’

m_log_email

Not yet documented.

mod_tkvstore

Simple (type,key)/value store. Stores data in the store with minimal latency and (local) serialization of get/put…

m_tkvstore

Simple read-only interface to the typed key-value store of mod_tkvstore. To get a value from the store: use m.tkvstore.

mask_progress

Sets the progress bar of a mask.

unmask

Removes a mask that was placed over an element using the mask action.

mask

Places a mask over an element, useful for blocking user interaction during lengthy postbacks.

mod_signup

This module presents an interface for letting users register themselves.

ssl_options

Request the SSL certificates for this site. The server_name property contains the hostname used by the client. (first…

move

Move an element to another place, appending it to the target. The element is given by id with the element argument, or…

module_activate

A module has been activated and started.

m_client_local_storage

Model to access the localStorage on the client (browser).

reload

Reload the current page.

redirect

This action redirects the browser to another page or back to the previous page.

Page handling

redirect reload

m_log

Not yet documented.

rsc_merge

Map to signal merging two resources. Move any information from the loser to the winner. The loser will be deleted.

survey_is_submit

Check if a question is a submitting question.