comment Tag

Utility Most Useful

Argument(s): note


Used to comment out code to prevent template tags or variables from being interpreted and/or to prevent the content from being delivered to the browser.

An optional note can be included in the open comment tag.


{% comment "Should we include this?" %}
  <small class="text-muted">
    Created on: {{ joke.created }}
    Last updated: {{ joke.updated }}
{% endcomment %}

Note that single lines of text can be commented out using {# and #}:

{# This is a comment. #}

Did we get something wrong? Is there a use case for the comment tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on Sept. 16, 2020, 7:33 p.m. EST