Skip to content

Commit

Permalink
VOTE-3189 improve help text for nvrf fields taxonomy edit form (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayestrada authored Jan 13, 2025
1 parent 2d66a61 commit 733ae01
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ third_party_settings:
classes: ''
show_empty_fields: false
id: ''
label_as_html: false
formatter: closed
description: ''
description: 'The following fields are used when displaying a field.'
required_fields: true
group_section_data:
children:
Expand All @@ -65,8 +66,9 @@ third_party_settings:
classes: ''
show_empty_fields: false
id: ''
label_as_html: false
formatter: closed
description: ''
description: 'The following fields are used when displaying a section.'
required_fields: true
id: taxonomy_term.nvrf_field.default
targetEntityType: taxonomy_term
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ field_name: field_content_version
entity_type: taxonomy_term
bundle: nvrf_field
label: 'Content version'
description: ''
description: 'This field will be used to track content versioning with external documents.'
required: false
translatable: true
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ id: taxonomy_term.nvrf_field.field_display_label
field_name: field_display_label
entity_type: taxonomy_term
bundle: nvrf_field
label: 'Display Label'
description: 'Use as a field label or a section heading.'
label: 'Display label'
description: 'Use as a field label or a section heading. This will be displayed in the form.'
required: true
translatable: true
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ id: taxonomy_term.nvrf_field.field_error_message
field_name: field_error_message
entity_type: taxonomy_term
bundle: nvrf_field
label: 'Error message'
label: 'Field error message'
description: ''
required: false
translatable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ id: taxonomy_term.nvrf_field.field_help_text
field_name: field_help_text
entity_type: taxonomy_term
bundle: nvrf_field
label: 'Help text'
label: 'Field help text'
description: ''
required: false
translatable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ id: taxonomy_term.nvrf_field.field_instructions
field_name: field_instructions
entity_type: taxonomy_term
bundle: nvrf_field
label: Instructions
description: ''
label: 'Field instructions'
description: 'This value may have specific use cases per field. If you need to use this field for a specific purpose, work with a developer to ensure it displays correctly. Typically this field is used to display field-specific instructions.'
required: false
translatable: true
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ field_name: field_nvrf_machine_name
entity_type: taxonomy_term
bundle: nvrf_field
label: 'NVRF machine name'
description: 'Enter "null" if this is a section.'
description: 'Enter "null" if this is a section. This is not displayed in the form but is used to map fields programmatically.'
required: true
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ id: taxonomy_term.nvrf_field.field_options
field_name: field_options
entity_type: taxonomy_term
bundle: nvrf_field
label: Options
description: '<em>Labels</em> are displayed in the NVRF digital form to the user. <em>Values</em> are mapped to the NVRF PDF.'
label: 'Field options'
description: "Options are only necessary for fields with multiple values to select from such as select lists. \r\n<br><em>Labels</em> are displayed in the NVRF digital form to the user. <em>Values</em> are mapped to the NVRF PDF."
required: false
translatable: true
default_value: { }
Expand Down
12 changes: 12 additions & 0 deletions web/modules/custom/vote_utility/inc/form_alter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ function vote_utility_form_alter(&$form, FormStateInterface $form_state, $form_i
}
}

/**
* Implements hook_form_FORM_ID_alter().
*/
function vote_utility_form_taxonomy_term_nvrf_field_form_alter(&$form, FormStateInterface $form_state, $form_id) {
// Change Name field label/description to improve editorial experience.
$form['name']['widget'][0]['value']['#title'] = t('Administrative label');
$form['name']['widget'][0]['value']['#description'] = t('This value is for identifying in Drupal and not used in the form display.');

// Hide relations options to improve editorial experience.
$form['relations']['#access'] = FALSE;
}

/**
* Implements hook_form_FORM_ID_alter().
*/
Expand Down

0 comments on commit 733ae01

Please sign in to comment.