-
Notifications
You must be signed in to change notification settings - Fork 60
Add documentation for contact field label modifier #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,40 @@ | |||||
|
|
||||||
| ``Hi {contactfield=firstname|there},`` | ||||||
|
|
||||||
| Token modifiers | ||||||
| *************** | ||||||
|
|
||||||
| Label modifier for select and boolean fields | ||||||
| ============================================= | ||||||
|
|
||||||
| For select and boolean type fields, you can use the ``|label`` modifier to display the human-readable label instead of the stored value. This is particularly useful when your select fields store values like codes or IDs but you want to display friendly labels to your Contacts. | ||||||
|
|
||||||
| **Syntax:** | ||||||
|
|
||||||
| .. code-block:: text | ||||||
| {contactfield=field_alias|label} | ||||||
| **Examples:** | ||||||
|
|
||||||
| For a select field with alias ``country_select`` that has options like ``us`` (United States), ``uk`` (United Kingdom): | ||||||
|
Check warning on line 27 in docs/configuration/variables.rst
|
||||||
|
|
||||||
| - ``{contactfield=country_select}`` - displays the value: ``us`` | ||||||
| - ``{contactfield=country_select|label}`` - displays the label: ``United States`` | ||||||
|
|
||||||
| For a boolean field with alias ``is_subscriber``: | ||||||
|
|
||||||
| - ``{contactfield=is_subscriber}`` - displays the value: ``1`` or ``0`` | ||||||
| - ``{contactfield=is_subscriber|label}`` - displays the label: ``Yes`` or ``No`` | ||||||
|
|
||||||
| This modifier works for both Contact fields and Company fields: | ||||||
|
|
||||||
| - ``{contactfield=company_type|label}`` - displays the label of a company select field | ||||||
|
Check warning on line 39 in docs/configuration/variables.rst
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - ``{contactfield=company_active|label}`` - displays the label of a company boolean field | ||||||
|
Check warning on line 40 in docs/configuration/variables.rst
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| .. note:: | ||||||
| The ``|label`` modifier only works with select and boolean field types. For other field types, it will display the regular value. | ||||||
|
Check warning on line 43 in docs/configuration/variables.rst
|
||||||
|
|
||||||
| Contact fields | ||||||
| ************** | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.