templates/dashboard/insights_view.html.twig line 1

Open in your IDE?
  1. {% for insight in insights %}
  2.     {% set thumbnail = asset('build/images/es_grey_400x400px.png') %}
  3.     {% if insight.imageCaption is defined and insight.imageCaption is not empty %}
  4.         {% set thumbnail = sonata_path(insight.imageCaption, 'banner' ) %}
  5.     {% endif %}
  6.     <a href="{{ path('insight_detail', { 'insightName': insight.url, 'categoryName': insight.category.slug }) }}">
  7.         <div class="swiper-slide insight" style="background-image: url('{{ thumbnail }}')">
  8.             <div class="insight-tittle">
  9.                 <h4>{{ insight.title }}</h4>
  10.             </div>
  11.             <div class="insight-data">
  12.                 <div class="insight-categoty">
  13.                     {% set visible_tags = ['Sports', 'News', 'Culture', 'Distribution', 'Contribution'] %}
  14.                     {% for tag in insight.tags %}
  15.                         {% if tag.name in visible_tags %}
  16.                             <span>{{ tag.name }}</span>
  17.                         {% endif %}
  18.                     {% endfor %}
  19.                 </div>
  20.                 <div class="insight-tag-date">
  21.                     <div class="insight-tag">
  22.                         Category: <span><a href="{{ path('insight_detail', { 'insightName': insight.url, 'categoryName': insight.category.slug }) }}">{{ insight.category.name }}</a></span>
  23.                     </div>
  24.                     <div class="insight-date">
  25.                         Published: <span>{{ insight.date|time_diff_or_date }}</span>
  26.                     </div>
  27.                 </div>
  28.             </div>
  29.         </div>
  30.     </a>
  31. {% endfor %}