modules

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

To test if a module is activated, for instance mod_signup:

{% if m.modules.active.mod_signup %}
    {# Do things that depend on mod_signup #}
{% endif %}

To print a list of all active modules:

{{ m.modules.all|pprint }}

Available Model API Paths

MethodPath patternDescription
get/all/...Return all known module names (enabled and disabled) for the current site.
get/enabled/...Return names of currently enabled modules for the site.
get/disabled/...Return names of currently disabled modules for the site.
get/active/+module/...Return whether module +module is active/enabled on the current site.
get/info/+module/...Return module metadata/info map for module +module.
get/uninstalledReturn uninstalled module names available on disk but not enabled for the site (z_module_manager:get_uninstalled). No further lookups.
get/provided/+service/...Return whether service +service is provided by an active module.
get/providedReturn services currently provided by enabled modules (z_module_manager:get_provided). No further lookups.
get/get_provided/...Return provider modules for a requested service list (z_module_manager:scan_provided).
get/get_depending/...Return modules that depend on the given module/service list (z_module_manager:scan_depending).

/+name marks a variable path segment. A trailing /... means extra path segments are accepted for further lookups.

Edit on GitHub