From 19ba0d2d59f4eabb2a2fb30f6eb609515000d729 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 22 Jan 2018 16:41:55 +0100 Subject: [PATCH 1/2] Mentioned how to override each children of a choice type --- form/create_custom_field_type.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst index 3b3c378a19f..038a5ff2bf3 100644 --- a/form/create_custom_field_type.rst +++ b/form/create_custom_field_type.rst @@ -153,6 +153,13 @@ link for details), create a ``shipping_widget`` block to handle this: renderBlock('choice_widget') ?> +.. tip:: + + You can further customize the template used to render each children of the + choice type. The block to override in that case is named ``widget name`` + + ``_entry_widget`` (e.g. for the Shipping widget you'd need to define + ``{% block shipping_entry_widget %} ... {% endblock %}``). + .. note:: Make sure the correct widget prefix is used. In this example the name should From 101d428527f447ecfa7b020cafbf4b62b42fee57 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Jan 2018 09:08:22 +0100 Subject: [PATCH 2/2] Reword --- form/create_custom_field_type.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst index 038a5ff2bf3..c8010b6e8d6 100644 --- a/form/create_custom_field_type.rst +++ b/form/create_custom_field_type.rst @@ -156,9 +156,10 @@ link for details), create a ``shipping_widget`` block to handle this: .. tip:: You can further customize the template used to render each children of the - choice type. The block to override in that case is named ``widget name`` + - ``_entry_widget`` (e.g. for the Shipping widget you'd need to define - ``{% block shipping_entry_widget %} ... {% endblock %}``). + choice type. The block to override in that case is named "block name" + + ``_entry`` + "element name" (``label``, ``errors`` or ``widget``) (e.g. to + customize the labels of the children of the Shipping widget you'd need to + define ``{% block shipping_entry_label %} ... {% endblock %}``). .. note::