You are viewing an older version of the Metrix documentation (1.x). View the latest version (2.x) →
Template Guides

Available Variables

The following methods are available to call in your Twig templates:

craft.metrix.getAllSources()

Returns a collection of Source objects.

craft.metrix.getAllEnabledSources()

Returns a collection of enabled Source objects.

craft.metrix.getAllConfiguredSources()

Returns a collection of configured Source objects.

craft.metrix.getSourceById(id)

Returns a Source object by its ID.

craft.metrix.getSourceByHandle(handle)

Returns a Source object by its handle.