Debugging Templates

There are times when you are working in a content layout that you need some more information about the variables available on the page. There are a few ways to do that.

Debug one variable

You can use the debug filter or the dump variable to debug one variable.

{{ variable|debug }}

or

{{ dump(variable) }}

You can set a label for the debug output by passing a parameter to the debug filter.

{{ variable|debug('Debug Label Here') }}

Debug multiple variables at once

You can pass multiple variables to the dump variable and each one will be debugged.

{{ dump(variable, variable2, variable3) }}

Output all variables

If no parameters are passed to the dump variable then the system will output all variables available to the template.

{{ dump() }}