Loading address_map_link.module +2 −7 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FormatterInterface; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -144,13 +143,9 @@ function address_map_link_field_formatter_settings_summary_alter(&$summary, $con function address_map_link_preprocess_field(&$variables) { if ($variables['element']['#field_type'] === 'address') { // Drill down to field formatter settings. $render_display = EntityViewDisplay::collectRenderDisplay($variables['element']['#object'], $variables['element']['#view_mode']); $field_display = $render_display->getComponent($variables['element']['#field_name']); // Check setting to determine if we are supposed to render as a link. if (isset($field_display['third_party_settings']['address_map_link'])) { $settings = &$field_display['third_party_settings']['address_map_link']; if (isset($variables['element']['#third_party_settings']['address_map_link'])) { $settings = $variables['element']['#third_party_settings']['address_map_link']; if ($settings['link_address'] && isset($settings['map_link_type'])) { /** @var \Drupal\address_map_link\MapLinkManager $mapLinkManager */ Loading config/schema/address_map_link.schema.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line field.formatter.third_party.address_map_link: type: mapping label: 'Address map link configuration' mapping: link_address: type: boolean label: 'Link Address to Map' map_link_type: type: string label: 'Map Link Type' map_link_position: type: string label: 'Map Link Position' map_link_text: type: string label: 'Map Link text' map_link_new_window: type: boolean label: 'Open map in new window' Loading
address_map_link.module +2 −7 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FormatterInterface; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -144,13 +143,9 @@ function address_map_link_field_formatter_settings_summary_alter(&$summary, $con function address_map_link_preprocess_field(&$variables) { if ($variables['element']['#field_type'] === 'address') { // Drill down to field formatter settings. $render_display = EntityViewDisplay::collectRenderDisplay($variables['element']['#object'], $variables['element']['#view_mode']); $field_display = $render_display->getComponent($variables['element']['#field_name']); // Check setting to determine if we are supposed to render as a link. if (isset($field_display['third_party_settings']['address_map_link'])) { $settings = &$field_display['third_party_settings']['address_map_link']; if (isset($variables['element']['#third_party_settings']['address_map_link'])) { $settings = $variables['element']['#third_party_settings']['address_map_link']; if ($settings['link_address'] && isset($settings['map_link_type'])) { /** @var \Drupal\address_map_link\MapLinkManager $mapLinkManager */ Loading
config/schema/address_map_link.schema.yml 0 → 100644 +19 −0 Original line number Diff line number Diff line field.formatter.third_party.address_map_link: type: mapping label: 'Address map link configuration' mapping: link_address: type: boolean label: 'Link Address to Map' map_link_type: type: string label: 'Map Link Type' map_link_position: type: string label: 'Map Link Position' map_link_text: type: string label: 'Map Link text' map_link_new_window: type: boolean label: 'Open map in new window'