You are here

geolocation-common-map-location.html.twig in Geolocation Field 8

{#
  When overriding this template, make sure to preserve
  - CSS-classes
  - parent - children hierarchy
  - data-lng and data-lat attributes
  or the attached Geolocation Javascript will fail.

  Changing the HTML tags, adding classes or adding content around or within the existing structure is no problem.
#}
<div
    class="geolocation"
    data-lat="{{ position.lat }}"
    data-lng="{{ position.lng }}"
    typeof="Place"
    {% if location_id is not empty %} data-location-id="{{ location_id }}" {% endif %}
    {% if disable_marker is empty %}
        data-set-marker="true"
        {% if icon is not empty %} data-icon="{{ icon }}" {% endif %}
        {% if marker_label is not empty %} data-marker-label="{{ marker_label }}" {% endif %}
    {% endif %}
>
    <span property="geo" typeof="GeoCoordinates">
        <meta property="latitude" content="{{ position.lat }}" />
        <meta property="longitude" content="{{ position.lng }}" />
    </span>
    <h2 class="location-title" property="name">{{ title }}</h2>
    <div class="location-content">{{ content }}</div>
</div>

File

templates/geolocation-common-map-location.html.twig
View source
  1. {#
  2. When overriding this template, make sure to preserve
  3. - CSS-classes
  4. - parent - children hierarchy
  5. - data-lng and data-lat attributes
  6. or the attached Geolocation Javascript will fail.
  7. Changing the HTML tags, adding classes or adding content around or within the existing structure is no problem.
  8. #}
  9. <div
  10. class="geolocation"
  11. data-lat="{{ position.lat }}"
  12. data-lng="{{ position.lng }}"
  13. typeof="Place"
  14. {% if location_id is not empty %} data-location-id="{{ location_id }}" {% endif %}
  15. {% if disable_marker is empty %}
  16. data-set-marker="true"
  17. {% if icon is not empty %} data-icon="{{ icon }}" {% endif %}
  18. {% if marker_label is not empty %} data-marker-label="{{ marker_label }}" {% endif %}
  19. {% endif %}
  20. >
  21. <span property="geo" typeof="GeoCoordinates">
  22. <meta property="latitude" content="{{ position.lat }}" />
  23. <meta property="longitude" content="{{ position.lng }}" />
  24. </span>
  25. <h2 class="location-title" property="name">{{ title }}</h2>
  26. <div class="location-content">{{ content }}</div>
  27. </div>