templates/news/news-list-ajax.html.twig line 1

Open in your IDE?
  1. {% for newsItem in newsList %}
  2.     {# news detail link #}
  3.     {% set detailLink = path('newslist', {
  4.         id: newsItem.id,
  5.         headline: toUri(newsItem.headline),
  6.         path: 'news-url-path'|trans
  7.     }) %}
  8.     {# news detail link #}
  9.             <div class="teaser news-overview-teaser news-teaser">
  10.                 {% for fieldItem in newsItem.content %}
  11.                     {% if fieldItem.type == "Gallery" %}
  12.                         {#  {% for image in fieldItem.GalleryImg.items %}#}
  13.                         {% if fieldItem.GalleryImg.items | length > 0 and fieldItem.GalleryImg.items[0] %}
  14.                             <a href="{{ detailLink }}">{{ fieldItem.GalleryImg.items[0].thumbnail('NewsTeaser').html | raw }}</a>
  15.                         {% endif %}
  16.                         {#{% endfor %}#}
  17.                     {% endif %}
  18.                 {% endfor %}
  19.                 <div class="content con-teaser ">
  20.                     <div class="date flex gap-10">
  21.                         <svg width="13" height="14.333" viewBox="0 0 13 14.333">
  22.                             <g id="Icon_feather-calendar" data-name="Icon feather-calendar"
  23.                                transform="translate(0.5 0.5)">
  24.                                 <path id="Pfad_4321" data-name="Pfad 4321"
  25.                                       d="M5.833,6h9.333A1.33,1.33,0,0,1,16.5,7.328V16.62a1.33,1.33,0,0,1-1.333,1.328H5.833A1.33,1.33,0,0,1,4.5,16.62V7.328A1.33,1.33,0,0,1,5.833,6Z"
  26.                                       transform="translate(-4.5 -4.615)" fill="none"
  27.                                       stroke="#6b675d"
  28.                                       stroke-linecap="round" stroke-linejoin="round"
  29.                                       stroke-width="1"/>
  30.                                 <path id="Pfad_4322" data-name="Pfad 4322" d="M24,3V5.771"
  31.                                       transform="translate(-15.333 -3)" fill="none" stroke="#6b675d"
  32.                                       stroke-linecap="round" stroke-linejoin="round"
  33.                                       stroke-width="1"/>
  34.                                 <path id="Pfad_4323" data-name="Pfad 4323" d="M12,3V5.771"
  35.                                       transform="translate(-8.667 -3)" fill="none" stroke="#6b675d"
  36.                                       stroke-linecap="round" stroke-linejoin="round"
  37.                                       stroke-width="1"/>
  38.                                 <path id="Pfad_4324" data-name="Pfad 4324" d="M4.5,15h12"
  39.                                       transform="translate(-4.5 -9.667)" fill="none"
  40.                                       stroke="#6b675d"
  41.                                       stroke-linecap="round" stroke-linejoin="round"
  42.                                       stroke-width="1"/>
  43.                             </g>
  44.                         </svg>
  45.                         <p>{{ newsItem.date | date('d.m.Y') }}</p>
  46.                     </div>
  47.                     <p class="teaser-headline title-headline"><a href="{{ detailLink }}">{{ newsItem.headline | u.truncate(35, '...') }}</a></p>
  48.                     <div class="basic colored no-margin secondary">
  49.                         <a href="{{ detailLink }}"><p>{{ newsItem.intro | u.truncate(125, '...') }}</p></a>
  50.                     </div>
  51.                     <div class="buttons-row no-margin">
  52.                         <button class="primary accent">
  53.                             <a href="{{ detailLink }}">
  54.                                 {{ 'Mehr'|trans }}
  55.                                 <svg width="15.708" height="10.709" viewBox="0 0 15.708 10.709">
  56.                                     <g transform="translate(0 0.354)">
  57.                                         <g transform="translate(0)">
  58.                                             <path class="line" d="M7.5,18h15" transform="translate(-7.5 -13)" fill="none" stroke="#b76e2b" stroke-linejoin="round" stroke-width="1"/>
  59.                                             <path class="arrow" d="M18,7.5l5.026,5L18,17.5" transform="translate(-8.027 -7.5)" fill="none" stroke="#b76e2b" stroke-width="1"/>
  60.                                         </g>
  61.                                     </g>
  62.                                 </svg>
  63.                             </a>
  64.                         </button>
  65.                     </div>
  66.                 </div>
  67.             </div>
  68. {% endfor %}
  69. {# next page #}
  70. {% set nextPageAjax = path('news-list', { page: paginationVariables.current + 1 }) %}
  71. {# previous page #}
  72. {# {% set previousPageAjax = path('news-list', {page: paginationVariables.current - 1}) %} #}
  73. {# {% if paginationVariables.previous is defined %}
  74.     <a href="{{ previousPageAjax }}">Previous</a>
  75. {% endif %} #}
  76. {% if paginationVariables.next is defined %}
  77. {#<div class="load-more ajaxListeButton moreNewsLink" id="newsButtonContainer" style="width: 0; height: 0; pointer-events: none; display: none;">#}
  78.     <a href="{{ nextPageAjax }}" id="moreNewsLink" title="load more" class="button primary ajax-btn" data-url="{{ nextPageAjax }}">{#{{ 'mehr_laden_newsAjaxLink' | trans }}#}</a>
  79. {#</div>#}
  80. {% endif %}