Reference

All Reference

Regular Expressions

match replace

reload

Reload the current page.

remove

Remove an element from the page.

remove_class

Remove a CSS class from an HTML element.

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.

request_context

Refresh the context or request process for the given request or action Called for every request that is not anonymous…

reset

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

resource_headers

Let all modules add resource specific response headers to the request. The accumulator is the list of headers to be set.

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

admin_merge_diff content_type_label content_type_urls summary temporary_rsc

Resources

delete_media delete_rsc dialog_delete_rsc dialog_duplicate_rsc dialog_edit_basics dialog_media_upload dialog_new_rsc…

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_delete

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

rsc_get

Resource is read, opportunity to add computed fields Used in a foldr with the read properties as accumulator.

rsc_import_fetch

Fetch the data for an import of a resource. Returns data in the format used by m_rsc_export and m_rsc_import. Either…

rsc_insert

Foldr for an resource insert, these are the initial properties and will overrule the properties in the insert request.

rsc_merge

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

rsc_pivot_done

Signal that a resource pivot has been done.

rsc_query_item

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

rsc_update

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

rsc_update_done

An updated resource has just been persisted. Observe this notification to execute follow-up actions for a resource…

rsc_upload

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

sanitize_element

Sanitize an HTML element.

sanitize_embed_url

Sanitize an embed url. The hostpart is of the format: <<"youtube.com/v...">> .

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.

scomp_script_render

Add extra javascript with the {% script %} tag. (map) Used to let modules inject extra javascript depending on the…

script

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

script

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

Search

moreresults

search_query

Map a custom search term to a #search_sql_term{} record.

search_query_term

Map a custom search term to a #search_sql_term{} record.

security_headers

Check and possibly modify the http response security headers All headers are in lowercase.

service_authorize

Request API logon

session_context

Refresh the context or request process for the given request or action Called for every request that is not anonymous…

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_user_language

Set the language of the context to a user’s prefered language

set_value

Set the value of a form field.

sha1

Translate a string to a sha1 hex value.

show

Show an element without any animation.

show_media

Convert the image markers in HTML from the Rich Text editor into image tags.

signup

Request a signup of a new or existing user. Arguments are similar to #signup_url{} Returns {ok, UserId} or {error

signup_check

signup_check Check if the signup can be handled, a fold over all modules. Fold argument/result is {ok, Props

signup_confirm

Signal that a user has been confirmed. (map, result is ignored)

signup_confirm_redirect

Fetch the page a user is redirected to after signing up with a confirmed identity

signup_done

Signal that a user has been signed up (map, result is ignored)

signup_failed_url

Signup failed, give the error page URL. Return {ok, Url} or undefined. Reason is returned by the signup handler for the…

signup_url

Handle a signup of a user, return the follow on page for after the signup. Return {ok, Url} ‘props’ is a map with…

Site configuration

This chapter describes the configuration options for your sites. There’s also global configuration.

slice

Perform array-slice operations on a list or string.

slide_down

Show an element by animating the height.

slide_fade_in

Show an element by animating the height and opacity.

slide_fade_out

Hide an element by animating the height and opacity.

slide_toggle

Toggle an element by sliding it up and down.

slide_up

Hide an element by animating the height.

slugify

Converts a text into a slug.

sort

The sort filter takes a list of items to sort. Items can be an ordinary list of terms, property lists, or maps. It can…

sortable

Mark an element as sortable.

sorter

A sorter is a container for sortables.

spaceless

Removes whitespace between HTML tags.

spinner

Add an AJAX activity indicator.

split

Splits the filter value into a list of values.

split_in

This filter split a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is…

ssl_options

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

stringify

Translates atoms, integers and floats to strings. The undefined value is translated to the empty string. Does not…

Strings

append capfirst center filesizeformat format_duration format_integer format_number format_price insert is_valid_email…

striptags

Removes all HTML tags from the value.

sub_day

Subtracts a day from a date. The value must be of the form {{Y,M,D},{H,I,S}} .

sub_hour

Subtracts an hour from a date. The value must be of the form {{Y,M,D},{H,I,S}} .

submit

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

sub_month

Subtracts a month from a date. The value must be of the form {{Y,M,D},{H,I,S}} .

sub_week

Subtracts a week from a date. The value must be of the form {{Y,M,D},{H,I,S}} .

sub_year

Subtracts a year from a date. The value must be of the form {{Y,M,D},{H,I,S}} .

summary

Extract a summary from a resource.

Survey

survey_answer_split survey_any_correct_answer survey_any_wrong_answer survey_as_pages survey_is_stop survey_is_submit…

survey

Dispatch rules Name Path Resource Args survey_results_download [“survey”,”results”,”download”,id]…

survey_any_correct_answer

Determine if any answer of a question was correct. Used for showing results of thurstone test questions.

survey_any_wrong_answer

Determine if any answer of a question was wrong. Used for showing results of thurstone test questions.

survey_as_pages

Split the page blocks into pages, prepare them for easy display in the survey question editor.

survey_get_handlers

Fetch list of handlers for survey submits.

survey_is_allowed_results_download

Check if the current user is allowed to download a survey.

survey_is_stop

Check if there is a ‘stop’ question in list of (survey) blocks

survey_is_submit

Check if a question is a submitting question.

Survey notifications

survey_get_handlers survey_is_allowed_results_download survey_is_submit survey_submit survey_result_columns…

survey_result_columns

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

survey_result_column_values

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

survey_result_column_values

Used by the survey module to add extra column values to the result editor.

survey_submit

A survey has been filled in and submitted.