From 9267518909b901e6f6948fbf31f16b26dd2dbe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 9 Feb 2016 13:17:20 +0100 Subject: [PATCH] add documentation about fields visibility in person --- source/bundles/person.rst | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/source/bundles/person.rst b/source/bundles/person.rst index 0d53f3108..0c31bdcd0 100644 --- a/source/bundles/person.rst +++ b/source/bundles/person.rst @@ -63,6 +63,15 @@ Example of configuration: chill_person: validation: birthdate_not_after: P15Y + person_fields: + # note: visible is the default config. This key may be omitted if visible is chosen. + nationality: hidden + email: hidden + place_of_birth: visible + phonenumber: hidden + country_of_birth: hidden + marital_status: visible + spoken_languages: hidden birthdate_not_after *string* The period duration before today during which encoding birthdate is not possible. The period is a string matching the format of `ISO_8601`, which is also use to build `DateInterval classes `_. @@ -70,3 +79,34 @@ birthdate_not_after *string* Example: `P1D`, `P18Y` Default value: `P1D` which means that birthdate before the current day (= yesterday) are allowed. + +person_fields *array* + This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are : + + * `nationality` + * `country_of_birth` + * `place_of_birth` + * `phonenumber` + * `email` + * `marital_status` + * `spoken_languages` + + Possibles values: `hidden` or `visible` (all other value will raise an Exception). + + Default value : `visible`, which means that all fields are visible. + + Example: + + .. code-block:: yaml + + chill_person: + person_fields: + nationality: hidden + email: hidden + phonenumber: hidden + +.. note:: + If all the field of a "box" are hidden, the whole box does not appears. Example: if the fields `phonenumber` and `email` are hidden, the title `Contact information` will be hidden in the UI. + +.. note:: + If you hide multiple fields, for a better integration you may want to override the template, for a better appeareance. See `the symfony documentation `_ about this feature.