Loading entity_embed_link.module +8 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ function entity_embed_link_form_entity_embed_dialog_alter(&$form, FormStateInter $form['attributes']['data-entity-embed-display-settings']['image_link']['#value'] = ''; } $form['attributes']['data-entity-embed-display-settings']['link_title'] = [ '#title' => t('Title'), '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'), '#type' => 'textfield', '#default_value' => isset($entity_element['data-entity-embed-display-settings']['link_title']) ?? '', ]; $form['attributes']['data-entity-embed-display-settings']['link_url'] = [ '#title' => t('Link to'), '#description' => t('The URL you would like this item to link to. Leave blank for none.'), Loading Loading @@ -63,5 +70,6 @@ function entity_embed_link_theme_registry_alter(&$theme_registry) { */ function entity_embed_link_preprocess_entity_embed_container(&$variables) { $variables['url'] = isset($variables['element']['#context']['data-entity-embed-display-settings']['link_url']) ? UrlHelper::filterBadProtocol($variables['element']['#context']['data-entity-embed-display-settings']['link_url']) : ''; $variables['title'] = $variables['element']['#context']['data-entity-embed-display-settings']['link_title'] ?? ''; $variables['target'] = $variables['element']['#context']['data-entity-embed-display-settings']['target'] ?? ''; } templates/entity-embed-container.html.twig +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ #} <article{{ attributes }}> {% if url %} <a href="{{ url }}" {% if target %}target="_blank"{% endif %}> <a href="{{ url }}" {% if title %}title="{{ title }}"{% endif %} {% if target %}target="_blank"{% endif %}> {{ children }} </a> {% else %} Loading Loading
entity_embed_link.module +8 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ function entity_embed_link_form_entity_embed_dialog_alter(&$form, FormStateInter $form['attributes']['data-entity-embed-display-settings']['image_link']['#value'] = ''; } $form['attributes']['data-entity-embed-display-settings']['link_title'] = [ '#title' => t('Title'), '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'), '#type' => 'textfield', '#default_value' => isset($entity_element['data-entity-embed-display-settings']['link_title']) ?? '', ]; $form['attributes']['data-entity-embed-display-settings']['link_url'] = [ '#title' => t('Link to'), '#description' => t('The URL you would like this item to link to. Leave blank for none.'), Loading Loading @@ -63,5 +70,6 @@ function entity_embed_link_theme_registry_alter(&$theme_registry) { */ function entity_embed_link_preprocess_entity_embed_container(&$variables) { $variables['url'] = isset($variables['element']['#context']['data-entity-embed-display-settings']['link_url']) ? UrlHelper::filterBadProtocol($variables['element']['#context']['data-entity-embed-display-settings']['link_url']) : ''; $variables['title'] = $variables['element']['#context']['data-entity-embed-display-settings']['link_title'] ?? ''; $variables['target'] = $variables['element']['#context']['data-entity-embed-display-settings']['target'] ?? ''; }
templates/entity-embed-container.html.twig +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ #} <article{{ attributes }}> {% if url %} <a href="{{ url }}" {% if target %}target="_blank"{% endif %}> <a href="{{ url }}" {% if title %}title="{{ title }}"{% endif %} {% if target %}target="_blank"{% endif %}> {{ children }} </a> {% else %} Loading