mod_base (zotonic_mod_base v1.0.0-rc.17)

mod_base is the base module, which acts as a container module holding most of Zotonic basic dispatch rules, Actions and Module tags.

Note that the amount of templates has been kept to a minimum in this module, so that sites are free to implement whatever templates they want. Core base module providing fundamental dispatch rules, actions, and template components used across sites.

Accepted Events

This module handles the following notifier callbacks:

  • observe_content_types_dispatch: Add an extra content-type to the 'id' controller using controller_api:content_types_provided.
  • observe_dispatch: Check if there is a controller or template matching the path using z_url:url_path_encode.
  • observe_edge_delete: If an edge is deleted, then force a repivot of the subject using z_pivot_rsc:insert_queue.
  • observe_edge_insert: If an edge is inserted, then force a repivot of the subject using z_pivot_rsc:insert_queue.
  • observe_hierarchy_updated: Renumber category ranges after hierarchy edits so tree lookups remain consistent.
  • observe_media_stillimage: Return the filename of a still image to be used for image tags using z_media_preview:can_generate_preview.

See also

dispatch rules.

Summary

Functions

manage_schema/2

observe_content_types_dispatch/3

observe_dispatch/2

observe_edge_delete/2

observe_edge_insert/2

observe_hierarchy_updated/2

observe_media_stillimage/2

-spec observe_media_stillimage(term(), z:context()) ->
                                  undefined |
                                  {ok, file:filename_all()} |
                                  {ok, {filepath, file:filename_all(), file:filename_all()}}.