The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dotiac::DTL::Tag::unparsed - The {% unparsed [FILTER[|FILTER2[|...]]] [as NEWVAR] %} tag

SYNOPSIS

Template file:

{% unparsed cut:"x"|lower %}
	{% FOR xi IN xtext %}... {% ENDFOR %} 
{% endunparsed %}
{% unparsed %}
	The {% unparsed %} .. {% endunparsed %}-Tag
{% endunparsed %}
{% unparsed as var %}<a href="{{ Tag }}">{% endunparsed %}
{{ var|escape }}

This will be rendered to:

{% for i in text %}...{% endfor %}
The {% unparsed %} .. {% endunparsed %}-Tag
&lt;a href=&quot;{{ Tag }}&quot;&gt;

DESCRIPTION

Reads template text verbatim, without evaluating it. Optionally runs it through a stack of FILTERS and returns it or saves into a NEW VARIABLE.

If a NEW VARIABLEname is given, the content will not be returned but saved in that variable name.

This tag will read everything till the next {% endunparsed %} tag, unless there is an inner {% unparsed %}, in that case it will skip the corresponding {% endunparsed %} tag. Therefore it requires the inner {% unparsed %}, {% endunparsed %} tags to be balanced.

The filtered/returned content is marked safe.

BUGS

When saved into a variable the string is no longer marked safe, it has to be marked save manually. This is intended to be that way for writing documentation of tags in the Django Template Language.

{% unparsed as image %}<img src="foo.jpg">{% endunparsed %}
{{ image }} {# &lt;img src=&quot;foo.jpg&quot;&gt; #}
{{ image|safe }} {# <img src="foo.jpg"> #}

Please report anything else at https://sourceforge.net/tracker2/?group_id=249411&atid=1126445

SEE ALSO

Dotiac::DTL, Dotiac::DTL::Addon, http://www.dotiac.com, http://www.djangoproject.com

AUTHOR

Marc-Sebastian Lucksch

perl@marc-s.de