diff --git a/openy_block/modules/openy_block_branch_contacts_info/src/Plugin/Block/BranchContactsInfo.php b/openy_block/modules/openy_block_branch_contacts_info/src/Plugin/Block/BranchContactsInfo.php index d1c47b16..4872d538 100644 --- a/openy_block/modules/openy_block_branch_contacts_info/src/Plugin/Block/BranchContactsInfo.php +++ b/openy_block/modules/openy_block_branch_contacts_info/src/Plugin/Block/BranchContactsInfo.php @@ -114,8 +114,9 @@ public function build() { $render_array['#fax'] = $node->field_location_fax->value; $render_array['#email'] = $node->field_location_email->value; - $render_array['#directions_field_title'] = $node->field_location_directions->title; + $render_array['#directions_field_title'] = $node->field_location_directions->title ?? $this->t('Directions'); $render_array['#directions_field_url'] = $node->field_location_directions->url; + $render_array['#directions_url'] = $node->field_location_directions->url ?? $render_array['#directions_url']; $render_array['#branch_title'] = $node->getTitle(); $branch_selector = openy_branch_selector_get_link($node->id()); diff --git a/openy_block/modules/openy_block_branch_contacts_info/templates/block-branch-contacts-info.html.twig b/openy_block/modules/openy_block_branch_contacts_info/templates/block-branch-contacts-info.html.twig index 825b1788..387bb04a 100644 --- a/openy_block/modules/openy_block_branch_contacts_info/templates/block-branch-contacts-info.html.twig +++ b/openy_block/modules/openy_block_branch_contacts_info/templates/block-branch-contacts-info.html.twig @@ -62,7 +62,7 @@
{{ address_title }}
- {{ 'Directions'|t }} + {{ directions_field_title }}
{% endif %} diff --git a/openy_location/modules/openy_loc_branch/config/install/field.field.node.branch.field_location_directions.yml b/openy_location/modules/openy_loc_branch/config/install/field.field.node.branch.field_location_directions.yml index 743aa879..436ece27 100644 --- a/openy_location/modules/openy_loc_branch/config/install/field.field.node.branch.field_location_directions.yml +++ b/openy_location/modules/openy_loc_branch/config/install/field.field.node.branch.field_location_directions.yml @@ -16,10 +16,18 @@ field_name: field_location_directions entity_type: node bundle: branch label: Directions -description: 'To remove the "Get Directions" link from the location page, just leave URL and Link text fields blank.' +description: 'Directions link is auto generated from the Address field, however you can put your own link here. For no link, enter: .' required: false translatable: true -default_value: { } +default_value: + - + attributes: { } + uri: 'route:' + title: Directions + options: + attributes: + class: + - '' default_value_callback: '' settings: title: 1 diff --git a/openy_location/modules/openy_loc_branch/openy_loc_branch.install b/openy_location/modules/openy_loc_branch/openy_loc_branch.install index 012972a9..0bddc993 100644 --- a/openy_location/modules/openy_loc_branch/openy_loc_branch.install +++ b/openy_location/modules/openy_loc_branch/openy_loc_branch.install @@ -522,3 +522,25 @@ function openy_loc_branch_update_8025() { } } } + +/** + * Directions field default values. + */ +function openy_loc_branch_update_8026() { + $config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/'; + // Update multiple configurations. + $configs = [ + 'field.field.node.branch.field_location_directions' =>[ + 'description', + 'default_value' + ], + ]; + + $config_updater = \Drupal::service('openy_upgrade_tool.param_updater'); + foreach ($configs as $config_name => $params) { + $config = $config_dir . $config_name . '.yml'; + foreach ($params as $param) { + $config_updater->update($config, $config_name, $param); + } + } +} diff --git a/openy_location/modules/openy_loc_camp/config/install/field.field.node.camp.field_location_directions.yml b/openy_location/modules/openy_loc_camp/config/install/field.field.node.camp.field_location_directions.yml index a8a8ce29..44eccc37 100644 --- a/openy_location/modules/openy_loc_camp/config/install/field.field.node.camp.field_location_directions.yml +++ b/openy_location/modules/openy_loc_camp/config/install/field.field.node.camp.field_location_directions.yml @@ -15,10 +15,18 @@ field_name: field_location_directions entity_type: node bundle: camp label: Directions -description: '' +description: 'Directions link is auto generated from the Address field, however you can put your own link here. For no link, enter: .' required: false translatable: true -default_value: { } +default_value: + - + attributes: { } + uri: 'route:' + title: Directions + options: + attributes: + class: + - '' default_value_callback: '' settings: link_type: 17 diff --git a/openy_location/modules/openy_loc_camp/openy_loc_camp.install b/openy_location/modules/openy_loc_camp/openy_loc_camp.install index 06e33b53..97112705 100644 --- a/openy_location/modules/openy_loc_camp/openy_loc_camp.install +++ b/openy_location/modules/openy_loc_camp/openy_loc_camp.install @@ -330,3 +330,25 @@ function openy_loc_camp_update_8014() { } } } + +/** + * Directions field default values. + */ +function openy_loc_camp_update_8015() { + $config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_camp') . '/config/install/'; + // Update multiple configurations. + $configs = [ + 'field.field.node.camp.field_location_directions' =>[ + 'description', + 'default_value' + ], + ]; + + $config_updater = \Drupal::service('openy_upgrade_tool.param_updater'); + foreach ($configs as $config_name => $params) { + $config = $config_dir . $config_name . '.yml'; + foreach ($params as $param) { + $config_updater->update($config, $config_name, $param); + } + } +} diff --git a/openy_location/modules/openy_loc_facility/config/install/field.field.node.facility.field_location_directions.yml b/openy_location/modules/openy_loc_facility/config/install/field.field.node.facility.field_location_directions.yml index 3c0e497b..ed7654c8 100644 --- a/openy_location/modules/openy_loc_facility/config/install/field.field.node.facility.field_location_directions.yml +++ b/openy_location/modules/openy_loc_facility/config/install/field.field.node.facility.field_location_directions.yml @@ -15,10 +15,18 @@ field_name: field_location_directions entity_type: node bundle: facility label: Directions -description: '' +description: 'Directions link is auto generated from the Address field, however you can put your own link here. For no link, enter: .' required: false translatable: true -default_value: { } +default_value: + - + attributes: { } + uri: 'route:' + title: Directions + options: + attributes: + class: + - '' default_value_callback: '' settings: link_type: 17 diff --git a/openy_location/modules/openy_loc_facility/openy_loc_facility.install b/openy_location/modules/openy_loc_facility/openy_loc_facility.install index 59ff78c5..d0b66e2c 100644 --- a/openy_location/modules/openy_loc_facility/openy_loc_facility.install +++ b/openy_location/modules/openy_loc_facility/openy_loc_facility.install @@ -309,3 +309,25 @@ function openy_loc_facility_update_8015() { } } } + +/** + * Directions field default values. + */ +function openy_loc_facility_update_8016() { + $config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_facility') . '/config/install/'; + // Update multiple configurations. + $configs = [ + 'field.field.node.facility.field_location_directions' =>[ + 'description', + 'default_value' + ], + ]; + + $config_updater = \Drupal::service('openy_upgrade_tool.param_updater'); + foreach ($configs as $config_name => $params) { + $config = $config_dir . $config_name . '.yml'; + foreach ($params as $param) { + $config_updater->update($config, $config_name, $param); + } + } +}