summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/builtins.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index bdac556652..5c08c66c21 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -2055,6 +2055,24 @@ For example::
If ``value`` is ``"my first post"``, the output will be ``"My First Post"``.
+.. templatefilter:: truncatechars
+
+truncatechars
+^^^^^^^^^^^^^
+
+.. versionadded:: 1.4
+
+Truncates a string if it is longer than the specified number of characters.
+Truncated strings will end with a translatable ellipsis sequence ("...").
+
+**Argument:** Number of characters to truncate to
+
+For example::
+
+ {{ value|truncatechars:9 }}
+
+If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel i..."``.
+
.. templatefilter:: truncatewords
truncatewords