Documentation

All Documentation

observe_survey_is_submit/2

Check if a question (page block) is a submitting question.

observe_survey_result_columns/3

Add header columns for export. The values are the names of the answers and the text displayed above the column. The…

observe_survey_result_column_values/3

Modify row with answers for export. The header columns are given and the values that are known are set in the folded…

observe_survey_submit/2

A survey has been filled in and submitted.

observe_tkvstore_delete/2

Delete a value from the typed key/value store

observe_tkvstore_get/2

Get a value from the typed key/value store

observe_tkvstore_put/2

Put a value into the typed key/value store

observe_translate/2

Request a translation of a list of strings. The resulting translations must be in the same order as the request. This…

observe_url_abs/2

Make a generated URL absolute, optionally called after url_rewrite by z_dispatcher

observe_url_fetch_options/2

Determine the URL fetch options for fetching the content of an URL. Used by z_fetch.erl.

observe_url_rewrite/3

Rewrite a URL after it has been generated using the z_dispatcher

observe_user_context/3

Set #context fields depending on the user and/or the preferences of the user.

observe_user_is_enabled/2

Check if a user is enabled. Enabled users are allowed to log in. Return true , false or undefined . If undefined is…

observe_validate_query_args/3

Called just before validation of all query arguments by z_validation.

Other cookbooks

Create a custom action Create a custom filter Create a custom model Create a custom controller Custom pivots Create a…

Other notifications

action_event_type activity activity_send admin_edit_blocks admin_menu admin_rscform category_hierarchy_save…

overlay_close

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

overlay_open

Renders a template on the server and opens a full screen overlay with the HTML output of the template.

Overriding Zotonic

This chapter describes how to override the templates, styling and logic provided by Zotonic.

overrules

See also

Page handling

redirect reload

page_path_unique

A validator to check whether a resource’s page path is unique:

pager

Show a pager for search results.

Page-specific dynamic backgrounds

Use edges ( page connections ) to associate backgrounds with pages.

parse_url

Parses an URL (URI) using uri_string:parse/1 .

pickle

Pickle an Erlang value so that it can be safely submitted with a form.

Pivot notifications

pivot_fields pivot_rsc_data pivot_update custom_pivot

Pivot Templates

Search uses database indices on special pivot columns and full text fields.

poll

Show a given survey (with the id parameter) as a “poll”. This presents a simpler interface, in which the user is…

Port configurations

Port configurations can be tricky, especially in combination with SSL. Here we explain all steps to come to a correctly…

postback

Performs a custom server side validation of an input value. This allows you to add your own validation logic to HTML…

postback

This action sends a message to the event handler on the server.

postback_event

Message sent by a user-agent on a postback event. Encapsulates the encoded postback and any additional data. This is…

pprint

Pretty print a zotonic value in a template.

predicate

Retrieve information about predicates. Predicates are the labels on edges (connections between resources) that give…

Predicates and Connections

dialog_predicate_new link unlink

presence

Check if an input has been filled in or checked.

print

See also

Proxying Zotonic with nginx

It is possible to put Zotonic behind the nginx <http://nginx.org/> web server, for example if you have other, non

publish

Publishes a message on the topic tree of the current page.

rand

Generates a random number. The number is from, and including, 1 up to, and including, the input value.

random

Returns a random value from a list of values. When the input is an empty list or not a list then the result is…

randomize

Shuffle a list of values.

range

Generate a list of integers, with an optional step.

ratelimit

Model for exposing current ratelimit timeout information for the active request context.

raw

Make a literal section which does not interpret tags.

rdf

Model for RDF summaries of resources. It provides short RDF-oriented summary maps for resources, with translated and…

redirect

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

Reference

All the nitty gritty details when the big picture has settled.

regroup

Not implemented tag, for forward compatibility with future ErlyDTL and Django versions.

Regular Expressions

match replace

Release Notes

Every time a Zotonic release is made, we create a document which lists the most important changes. This page contains…

reload

Reload the current page.

remove

Remove an element from the page.

remove_class

Remove a CSS class from an HTML element.

render

Render a template.

replace

Regular expression replacement of a pattern with a string.

replace

Replace the target HTML element by new one.

replace_args

Replace $N placeholders in string from a list of replacement values.

req

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

reset

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

Reset a user’s password

Emergency password reset when you can’t get into the admin interface.

Resource lists

group_firstchar group_title_firstchar is_a is_not_a is_visible media_for_language

Resource notifications

rsc_delete rsc_get rsc_import_fetch rsc_insert rsc_merge rsc_pivot_done rsc_query_item rsc_update rsc_update_done…

Resources

delete_media delete_rsc dialog_delete_rsc dialog_duplicate_rsc dialog_edit_basics dialog_media_upload dialog_new_rsc…

Resources

admin_merge_diff content_type_label content_type_urls summary temporary_rsc

Resources

Resources are Zotonic’s main data unit. You may want to familiarise yourself with the Zotonic data model in the User…

Restore/upgrade content db from backup

Contributed by: Scott Finnie

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…

reversed

Reverse a list.

rjust

Justifies the value in a field of a certain width to the right, using spaces.

round

Round a floating point value to the nearest integer.

round_significant

Round a number value to a number of significant digits. The significance defaults to two digits.

rsc

The main resource model, which is the central part of the Zotonic data model. This model provides an interface to all…

rsc_export

Export a full resource representation for API and model access.

rsc_gone

This model tracks deleted resources (see m_rsc). Its primary goal is to be able to determine if a resource never…

rsc_import

Import model for resources exported by m_rsc_export .

rsc_update

Resource update helper module used by m_rsc .

Running on Port 80 and Port 443

Using standard ports helps visitors discover your page and removes the awkward port number from URLs.

sanitize_html

Sanitize a HTML code. Removes elements and attributes that might be dangerous, like <script\> elements.

sanitize_url

Sanitize an URL. Removes URLs that might be dangerous, like javascript: URLs.

script

This action executes JavaScript directly. It can be used to interface with non-Zotonic JavaScript libraries and…

script

This tag is the placeholder where all generated JavaScript scripts will be output on the page.

Search

moreresults

search

The m_search model provides access to different kinds of search queries for searching through models.

Search

Using the query search API you can retrieve lists of resources in various ways. In your templates, you do so through…

search_status

Model for search subsystem status, including facet table health checks and facet definition metadata.

Security, templates and XSS prevention

Ensuring that you don't fall victim to cross site scripting and other injection attacks takes vigilance, eye for…

seo

Model for SEO-related settings and generated SEO metadata, including webmaster verification keys, analytics settings

seo_sitemap

Model for sitemap generation metadata, including available urlsets and paged urlset export values.

Server configuration

This chapter describes how to configure your Linux server for running Zotonic.

server_storage

Model to access the server side storage of data.

set_class

Set the class of an element.

set_url_language

Change the language of an URL to another language. Useful to generate alternative URLs for a page.

set_value

Set the value of a form field.

sha1

Translate a string to a sha1 hex value.

Share variable binding across blocks

How to avoid having to call the same query inside several blocks of the same page

Shell cookbook

Activate/deactivate modules Filter and convert characters Erlang tab completion Debugging db (query) issues Reset a…

show

Show an element without any animation.