templates/projects-detail.html.twig line 41

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block content %}
  3.     <main class="main container--padding--sidebars">
  4.         <div class="container-fluid">
  5.             <div class="row">
  6.                 <div class="col-lg-10 offset-lg-1 px-md-0 pt-md-5">
  7.                     <section class="section--projects section-intro">
  8.                         <h1>{{ project.title }} <br> {{ project.location }}</h1>
  9.                     </section>
  10.                 </div>
  11.             </div><!--/ .row -->
  12.         
  13.             <div class="card__project">            
  14.             {% if project.photos|length > 1 %}
  15.                 <div class="swiper swiper--project-detail" id="project-detail-slider">
  16.                     <div class="swiper-wrapper">
  17.                         {% for photo in project.photos.items %}
  18.                             <div class="swiper-slide">
  19.                                 <div class="img-wrapper">
  20.                                     {{ photo.getThumbnail('ProjectDetailSliderThumbnail').html({
  21.                                         'imgAttributes': {
  22.                                             'loading': loop.index != 1 ? 'lazy': 'eager'
  23.                                         }
  24.                                     })|raw }}
  25.                                 </div>
  26.                                 <p class="slide-title">{{ project.title }} &mdash; {{ project.location }}{# &mdash; {{ 'Architect:' | trans }} {{ project.architect }} #}</p>
  27.                             </div>
  28.                         {% endfor %}
  29.                     </div>
  30.                     <div class="swiper-button-prev"></div>
  31.                     <div class="swiper-button-next"></div>
  32.                 </div>
  33.             {% elseif project.photos.items|length == 1 %}
  34.                 <div class="row">
  35.                     <div class="col-lg-10 offset-lg-1 px-md-0">
  36.                         <div class="img-wrapper">
  37.                             {{ project.photos.items[0].getThumbnail('ProjectDetailSliderThumbnail').html({
  38.                                 'imgAttributes': {
  39.                                     'loading': 'eager'
  40.                                 }
  41.                             })|raw }}
  42.                             <p class="slide-title">{{ project.title }} &mdash; {{ project.location }}{# &mdash; {{ 'Architect:' | trans }} {{ project.architect }} #}</p>
  43.                         </div>
  44.                     </div>
  45.                 </div><!--/ .row -->
  46.             {% endif %}
  47.             </div>
  48.             <div class="row">
  49.                 <div class="col-lg-10 offset-lg-1">
  50.                     <div class="row section__padding">
  51.                         <div class="project-detail-intro">
  52.                             {{ project.description|nl2br }}
  53.                         </div>
  54.                     </div>
  55.                     {% if project.link %}
  56.                     <div class="row btn__appointment">
  57.                         <div class="d-flex justify-content-center">
  58.                             <a href="{{ project.link.getHref()  }}" class="btn btn-dark">{{ project.link.getText() }}</a>
  59.                         </div>
  60.                     </div>
  61.                     {% endif %}
  62.                 </div>
  63.             </div><!--/ .row -->
  64.         </div><!--/ .container -->
  65.         <section class="section--richcontent">
  66.         {% for contentBlock in project.contentBlocks %}
  67.             {% include 'content/' ~ contentBlock.type ~ '.html.twig' with {'contentBlock': contentBlock} %}
  68.         {% endfor %}
  69.         </section>
  70.         <section class="container-fluid section--filter">
  71.             <div class="row">
  72.                 <div class="col-lg-10 offset-lg-1">
  73.                     <div class="section--head">
  74.                         <h2>{{ 'Bekijk onze andere projecten' | trans }}</h2>
  75.                         <p>{{ 'Intro voor bekijk onze andere projecten' | trans }}</p>
  76.                     </div>
  77.                     <div class="row gx-xl-5">
  78.                         {# Inject first position block if necessary #}
  79.                         {% if quotes[0] is defined %}
  80.                         <div class="col-sm-6 col-lg-4">
  81.                             <blockquote class="quote-item">
  82.                                 <p>{{ quotes[0].text|nl2br }}</p>
  83.                                 <p class="quote-item__author">{{ quotes[0].author }}</p>
  84.                             </blockquote>
  85.                         </div>
  86.                         {% endif %}
  87.                         
  88.                         {% for project in project.relatedProjects %}
  89.                             {% set url = app_project_detaillink(project) %}
  90.                         
  91.                             <div class="col-sm-6 col-lg-4">
  92.                                 <a class="project-item" href="{{ url }}">
  93.                                     <div class="project-item__img">
  94.                                         {% if project.photoIndex %}
  95.                                         <div class="img-wrapper">{{ project.photoIndex.thumbnail('ProjectIndexThumbnail').html|raw }}</div>
  96.                                         {% else %}
  97.                                         <img src="https://via.placeholder.com/609x404/ccc" alt="" class="img-fluid">
  98.                                         {% endif %}
  99.                                     </div>
  100.                                     <div class="project-item__title">{{ project.getTitle() }} - {{ project.getLocation() }} </div>
  101.                                 </a>
  102.                             </div>
  103.                             {# Inject quote block if necessary #}
  104.                             {% if quotes[loop.index] is defined %}
  105.                             <div class="col-sm-6 col-lg-4">
  106.                                 <blockquote class="quote-item">
  107.                                     <p>{{ quotes[loop.index].text|nl2br }}</p>
  108.                                     <p class="quote-item__author">{{ quotes[loop.index].author }}</p>
  109.                                 </blockquote>
  110.                             </div>
  111.                             {% endif %}
  112.                         {% endfor %}
  113.                     </div>
  114.                 </div>
  115.             </div>
  116.         </section>
  117.         <div class="white--space"></div>
  118.     </main>
  119. {% endblock %}