templates/Tour/detail.html.twig line 1

Open in your IDE?
  1. {# @var tour \Pimcore\Model\DataObject\AlpsteinTour #}
  2. {% extends "Layout/default.html.twig" %}
  3. {% do pimcore_placeholder('disableWeatherSlide').set(true) %}
  4. {% set detailUrl = linkGenerator().generate(tour) %}
  5. {% if not detailUrl is same as(app.request.pathInfo) %}
  6.     {% do elements_robots().setNoIndex(true) %}
  7. {% endif %}
  8. {% do pimcore_placeholder( 'addBreadcrumb' ).set({
  9.     'parentId': document.id,
  10.     'url': detailUrl,
  11.     'label': tour.name
  12. }) %}
  13. {% do elements_head_title().setTitle(tour.metaTitle ?: tour.name, true) %}
  14. {% do elements_opengraph().setDescription(tour.metaDescription ?: tour.shortText) %}
  15. {% do elements_canonical(detailUrl) %}
  16. {% do elements_head_title(tour.metaTitle ?: tour.name, true) %}
  17. {% do elements_head_meta(tour.metaDescription ?: chooseDescription(tour.shortText, tour.longText), true) %}
  18. {% if tour.primaryImage %}
  19.     {% do elements_opengraph().addImage(tour.primaryImage.thumbnail('hero').getPath()) %}
  20. {% endif %}
  21. {% block content %}
  22.     {{ jld_root(tour, true, true) }}
  23.     {% set heroImage = null %}
  24.     {% set heroImageAlt = tour.category[0].name ~ ' ' ~ tour.name ~ ' - Touren-Impression #1' %}
  25.     {% if tour.primaryImage %}
  26.         {% set heroImage = tour.primaryImage %}
  27.     {% elseif tour.images and tour.images[0] %}
  28.         {% set heroImage = tour.images[0] %}
  29.     {% endif %}
  30.     {% if heroImage and heroImage.metadata is iterable %}
  31.         {% for metadata in heroImage.metadata %}
  32.             {% if metadata['name'] == 'alt' %}
  33.                 {% set heroImageAlt = metadata['data'] %}
  34.             {% endif %}
  35.         {% endfor %}
  36.     {% endif %}
  37.     {{ include('Includes/hero.html.twig', {'image': heroImage, 'alt': heroImageAlt}) }}
  38.     {{ include('Navigation/breadcrumb.html.twig') }}
  39.     {#
  40.     open: badge-success
  41.     partially-open: badge-info
  42.     closed: badge-danger
  43.     #}
  44.     {% set badge = [] %}
  45.     {% if tour.openedState %}
  46.         {% if tour.openedState == 'open' %}
  47.             {% set badge = {
  48.                 'color': 'success',
  49.                 'text': 'tour.Geöffnet'|trans
  50.             } %}
  51.         {% elseif tour.openedState == 'partially-open' %}
  52.             {% set badge = {
  53.                 'color': 'info',
  54.                 'text': 'tour.Teilweise geöffnet'|trans
  55.             } %}
  56.         {% elseif tour.openedState == 'closed' %}
  57.             {% set badge = {
  58.                 'color': 'danger',
  59.                 'text': 'tour.Geschlossen'|trans
  60.             } %}
  61.         {% endif %}
  62.     {% endif %}
  63.     {{ include('Includes/main-title-block-splitted.html.twig', {
  64.         headline: tour.name,
  65.         badge: badge,
  66.         badgeAddon: tour.publicTransportFriendly ? ('<span class="icon icon-traffic mr-2" aria-label="mit Bus erreichbar" data-toggle="tooltip" data-original-title="' ~ 'tour.mit Bus erreichbar'|trans  ~ '"></span>') : '',
  67.         description: tour.shortText,
  68.         expand: tour.longText
  69.     }) }}
  70.     <section class="container container-sm content-block">
  71.         {{ include('Tour/detail/tourProperties.html.twig') }}
  72.         {{ include('Tour/detail/tourSeasons.html.twig') }}
  73.         {{ include('Tour/detail/tourDetails.html.twig') }}
  74.     </section>
  75.     {{ include('Tour/detail/map.html.twig') }}
  76.     {{ include('Tour/detail/tourTabbing.html.twig') }}
  77.     {{ include('Tour/detail/tourGallery.html.twig') }}
  78.     {% set weatherStation = getWeatherStationByAlpsteinTour(tour) %}
  79.     {% if weatherStation %}
  80.         {{ include('Includes/weather-slide.html.twig', {'weatherStation': weatherStation}) }}
  81.     {% endif %}
  82.     {{ include('Includes/demiNearbySlide.html.twig', {
  83.         image: tour.imageTeaserOverrideAccomodation ?: siteConfig.textSlideImageDefault,
  84.         headline: 'tour-detail.Unterkünfte in der Nähe'|trans,
  85.         id: tour.id,
  86.         lat: tour.startingPoint.latitude,
  87.         lng: tour.startingPoint.longitude,
  88.         btnText: 'tour.detail.Weiter zur Suche'|trans
  89.     }) }}
  90.     {% if recommendations is defined and recommendations is not empty %}
  91.         {{ include('Tour/detail/recommendations.html.twig', {'tours': recommendations}) }}
  92.     {% endif %}
  93. {% endblock %}
  94. {% block javascripts %}
  95.     {% if not app.request.get('onlyInlineCss') %}
  96.         {{ include('Layout/includes/encore.html.twig', {
  97.             'staticDebugMode': staticDebugMode,
  98.             'file': 'js/tour'
  99.         }) }}
  100.     {% endif %}
  101. {% endblock %}