{% load emoticons_tags %}
Using the emoticons in templates is fairly simple, all depends if you need to apply the transformations on raw text or on variables.
{% verbatim %}
{% load emoticons_tags %}
{% emoticons %}
Coding is fun :)
{% endemoticons %}
{% with content="Coding is cool :D" %}
{{ content|emoticons }}
{% endwidth %}
{% endverbatim %}
The snippet will generate this output:
{% emoticons %}Coding is fun :)
Coding is cool :D
{% endemoticons %}
You can also exclude the emoticon transformations on specific markups if you are using HTML.
{% verbatim %}
{% load emoticons_tags %}
{% emoticons "h3" %}
<h3>Coding is fun :)</h3>
<p>Coding is cool :D</p>
{% endemoticons %}
{% endverbatim %}
The snippet will generate this output:
{% emoticons "h3" %}Coding is fun :)
Coding is cool :D
{% endemoticons %}
| Emoticon | Aliases |
|---|---|
| {{ emoticons.0|safe|emoticons }} |
{% for emoticon in emoticons %}{{ emoticon }} {% endfor %}
|