You are here

image-formatter-with-hotspots.html.twig in Image Hotspots 8

{#
/**image_hotspots
 * @file
 * Theme implementation for a hotspots UI.
 */
#}

<div class="image-hotspots-wrapper" data-field-name="{{ info.field_name }}"  data-image-style="{{ info.image_style }}" data-fid="{{ info.fid }}" data-hotspots-style="{{ info.hotspots_style }}" data-langcode="{{ info.langcode }}">
  <div class="image-wrapper">
    {{ image }}
  </div>
  <div class="labels"></div>
  {% if info.editable %}
    {% if info.translatable == false %}
      <div class="add-button action" title="{% trans %}Add new hotspot to image{% endtrans %}">Add hotspot</div>
    {% endif %}
    <div class="edit-form-wrapper">
      <div class="form-header">
        <div class="close-button"></div>
      </div>
      <form class="edit-form">
        <div class="form-messages"></div>
        <input type="text" name="hotspots-title" placeholder="{% trans %}Title{% endtrans %}" required>
        <textarea name="hotspots-description" rows="3" placeholder="{% trans %}Description{% endtrans %}"></textarea>
        <input type="text" name="hotspots-link" placeholder="{% trans %}Link{% endtrans %}">
        <div>
          <input type="checkbox" name="hotspots-target" id="target" value="_blank">
          <label for="target">{% trans %}Open in a new window{% endtrans %}</label>
        </div>
        <button type="submit" name="save">{% trans %}Save{% endtrans %}</button>
      </form>
    </div>
  {% endif %}
</div>

File

templates/image-formatter-with-hotspots.html.twig
View source
  1. {#
  2. /**image_hotspots
  3. * @file
  4. * Theme implementation for a hotspots UI.
  5. */
  6. #}
  7. <div class="image-hotspots-wrapper" data-field-name="{{ info.field_name }}" data-image-style="{{ info.image_style }}" data-fid="{{ info.fid }}" data-hotspots-style="{{ info.hotspots_style }}" data-langcode="{{ info.langcode }}">
  8. <div class="image-wrapper">
  9. {{ image }}
  10. </div>
  11. <div class="labels"></div>
  12. {% if info.editable %}
  13. {% if info.translatable == false %}
  14. <div class="add-button action" title="{% trans %}Add new hotspot to image{% endtrans %}">Add hotspot</div>
  15. {% endif %}
  16. <div class="edit-form-wrapper">
  17. <div class="form-header">
  18. <div class="close-button"></div>
  19. </div>
  20. <form class="edit-form">
  21. <div class="form-messages"></div>
  22. <input type="text" name="hotspots-title" placeholder="{% trans %}Title{% endtrans %}" required>
  23. <textarea name="hotspots-description" rows="3" placeholder="{% trans %}Description{% endtrans %}"></textarea>
  24. <input type="text" name="hotspots-link" placeholder="{% trans %}Link{% endtrans %}">
  25. <div>
  26. <input type="checkbox" name="hotspots-target" id="target" value="_blank">
  27. <label for="target">{% trans %}Open in a new window{% endtrans %}</label>
  28. </div>
  29. <button type="submit" name="save">{% trans %}Save{% endtrans %}</button>
  30. </form>
  31. </div>
  32. {% endif %}
  33. </div>