debug

Shows which variables are assigned for use in the current template’s scope:

{% debug %}

Optionally, variable names can be provided to be debugged:

{% debug session_id q template zotonic_dispatch %}

By default, all key nodes are collapsed. Expanded, each node contains the value associated and highlighted as Erlang code:

Debug output with expanded variable nodes

The debug scomp contains three buttons at the top right:

  • _: Collapse all key nodes;
  • □: Expand all key nodes;
  • ×: Removes the debug element from the HTML document.

There is also a resizer at the bottom right corner to resize the debug element horizontally.

Edit on GitHub

Referred by

Developer guide

Create a page layout

Use an existing site base template as your starting point. Put shared document structure in the base and page-specific markup in blocks.

Developer guide

Follow a request to its template

Start with the URL that gives an unexpected result. Check its hostname: Zotonic uses it to select a site before matching the site's dispatch rules.