You can use the source value to add specific elements to one of the editors — theme editor or code editor. The possible values are:
  • "theme-editor": When the template is being rendered within the Theme Editor
  • "code-editor": When the template is being rendered within the Code Editor
  • nil: When the template is not being rendered within an editor

Syntax

{% source %}

Scope

It is globally accessible, in any template, section or block.

Example

{% if source == 'code-editor' %}
<p>This appears only within the code editor</p>
{% endif %}
<p>This appears only within the code editor</p>