Skip to content

Commit 45650d6

Browse files
committed
Update docs
1 parent c89999d commit 45650d6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/source/tutorial/template_components.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ A little helper: the ``split`` filter
254254
-------------------------------------
255255

256256
.. index::
257-
single: ``split`` filter
257+
single: split filter
258+
single: choices in template components
258259

260+
If you load the ``cms_component`` template tag library, you can use the ``split`` filter to convert a string into a list.
259261
Some component properties require a list of values, such as the ``parent_classes`` or ``child_classes``.
260262
You can use the ``split`` filter to convert a string into a list. For example, if you want to allow the
261263
**Hero component** to be a child of the **Container or Column component**, you can set the ``parent_classes``
@@ -272,10 +274,15 @@ Additionally, ``split`` can be used to create tuples as needed for the ``choices
272274
``forms.ChoiceField``. For example, if you want to create a choice field with two options, you can use the
273275
following code::
274276

275-
{% field "color" forms.ChoiceField choices="Red <red>|Green <green>|Default <blue>"|split name=_("Color") %}
277+
{% field "color" forms.ChoiceField choices=_("Red <red>|Green <green>|Default <blue>")|split name=_("Color") %}
276278

277279
The verbose choice label is appended by the actual value of the field between angle brackets (``<...>``).
278280

281+
.. note::
282+
283+
For translators it is important to know, that they **should not translate** the value in angle brackets.
284+
The German translation of the above example string might be ``Rot <red>|Grün <green>|Standard <blue>``.
285+
279286

280287
Limitations of template components
281288
----------------------------------

0 commit comments

Comments
 (0)