Commit 426f4593 authored by Azz-eddine BERRAMOU's avatar Azz-eddine BERRAMOU
Browse files

Issue #2931612: No Title Field as in Screenshot

parent a5014688
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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.'),
@@ -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'] ?? '';
}
+1 −1
Original line number Diff line number Diff line
@@ -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 %}