var/cache/website/dev/twig/3b/3bf4032bc3cd8a75bffe3a6ccbc28e97.php line 73

  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* includes/blocks/news-grid.html.twig */
  14. class __TwigTemplate_a9605d5b5517d18d55ef1a4c83101a12 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""includes/blocks/news-grid.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""includes/blocks/news-grid.html.twig"));
  33.         // line 2
  34.         $context["tags"] = twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'2$this->source); })()), "tags", [], "any"falsefalsefalse2);
  35.         // line 3
  36.         echo "
  37. ";
  38.         // line 5
  39.         $context["locale"] = ((twig_get_attribute($this->env$this->sourcetwig_split_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'5$this->source); })()), "request", [], "any"falsefalsefalse5), "locale", [], "any"falsefalsefalse5), "_"), 0, [], "array"truetruefalse5)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_split_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'5$this->source); })()), "request", [], "any"falsefalsefalse5), "locale", [], "any"falsefalsefalse5), "_"), 0, [], "array"falsefalsefalse5), "de")) : ("de"));
  40.         // line 6
  41.         echo "
  42. ";
  43.         // line 8
  44.         $context["news"] = $this->env->getRuntime('App\Twig\AppRuntime')->getNews((isset($context["tags"]) || array_key_exists("tags"$context) ? $context["tags"] : (function () { throw new RuntimeError('Variable "tags" does not exist.'8$this->source); })()));
  45.         // line 9
  46.         echo "
  47. ";
  48.         // line 11
  49.         $context["stories"] = _twig_default_filter($this->env->getRuntime('App\Twig\AppRuntime')->getDataFromSmartContent(twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'11$this->source); })()), "stories", [], "any"falsefalsefalse11), (isset($context["locale"]) || array_key_exists("locale"$context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.'11$this->source); })())), []);
  50.         // line 12
  51.         echo "
  52. ";
  53.         // line 14
  54.         $context["publications"] = _twig_default_filter($this->env->getRuntime('App\Twig\AppRuntime')->getDataFromSmartContent(twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'14$this->source); })()), "publications", [], "any"falsefalsefalse14), (isset($context["locale"]) || array_key_exists("locale"$context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.'14$this->source); })())), []);
  55.         // line 15
  56.         echo "
  57. ";
  58.         // line 17
  59.         $context["pages"] = _twig_default_filter($this->env->getRuntime('App\Twig\AppRuntime')->getDataFromSmartContent(twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'17$this->source); })()), "pages", [], "any"falsefalsefalse17), (isset($context["locale"]) || array_key_exists("locale"$context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.'17$this->source); })())), []);
  60.         // line 18
  61.         echo "
  62. ";
  63.         // line 20
  64.         $context["sorted"] = $this->env->getRuntime('App\Twig\AppRuntime')->sortByDate((isset($context["stories"]) || array_key_exists("stories"$context) ? $context["stories"] : (function () { throw new RuntimeError('Variable "stories" does not exist.'20$this->source); })()), (isset($context["publications"]) || array_key_exists("publications"$context) ? $context["publications"] : (function () { throw new RuntimeError('Variable "publications" does not exist.'20$this->source); })()), (isset($context["pages"]) || array_key_exists("pages"$context) ? $context["pages"] : (function () { throw new RuntimeError('Variable "pages" does not exist.'20$this->source); })()), (isset($context["news"]) || array_key_exists("news"$context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.'20$this->source); })()), twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'20$this->source); })()), "contentMixed", [], "any"falsefalsefalse20));
  65.         // line 21
  66.         echo "
  67. ";
  68.         // line 22
  69.         if ((( !twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'22$this->source); })()), "expandEnabled", [], "any"falsefalsefalse22) || twig_test_empty(twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'22$this->source); })()), "newsGridExpandButtonLabel", [], "any"falsefalsefalse22))) && (twig_length_filter($this->env, (isset($context["sorted"]) || array_key_exists("sorted"$context) ? $context["sorted"] : (function () { throw new RuntimeError('Variable "sorted" does not exist.'22$this->source); })())) > twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'22$this->source); })()), "itemsCount", [], "any"falsefalsefalse22)))) {
  70.             // line 23
  71.             echo "    ";
  72.             // line 27
  73.             echo "    ";
  74.             $context["sorted"] = twig_slice($this->env, (isset($context["sorted"]) || array_key_exists("sorted"$context) ? $context["sorted"] : (function () { throw new RuntimeError('Variable "sorted" does not exist.'27$this->source); })()), 0twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'27$this->source); })()), "itemsCount", [], "any"falsefalsefalse27));
  75.         }
  76.         // line 29
  77.         echo "
  78. <div class=\"teaser-grid ";
  79.         // line 30
  80.         if (twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'30$this->source); })()), "inverted", [], "any"falsefalsefalse30)) {
  81.             echo "teaser-grid--inverted ";
  82.         }
  83.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'30$this->source); })()), "top", [], "any"falsefalsefalse30), "html"nulltrue);
  84.         echo "
  85.   ";
  86.         // line 31
  87.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'31$this->source); })()), "bottom", [], "any"falsefalsefalse31), "html"nulltrue);
  88.         echo "\" x-data=\"teasergrid(";
  89.         echo twig_escape_filter($this->envtwig_length_filter($this->env, (isset($context["sorted"]) || array_key_exists("sorted"$context) ? $context["sorted"] : (function () { throw new RuntimeError('Variable "sorted" does not exist.'31$this->source); })())), "html"nulltrue);
  90.         echo ",";
  91.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'31$this->source); })()), "itemsCount", [], "any"falsefalsefalse31), "html"nulltrue);
  92.         echo ",3)\">
  93.     <div class=\"teaser-grid__container\">
  94.         <div class=\"teaser-grid__teasers\" x-ref=\"teasers\" id=\"teasers\">
  95.             ";
  96.         // line 34
  97.         $context['_parent'] = $context;
  98.         $context['_seq'] = twig_ensure_traversable((isset($context["sorted"]) || array_key_exists("sorted"$context) ? $context["sorted"] : (function () { throw new RuntimeError('Variable "sorted" does not exist.'34$this->source); })()));
  99.         foreach ($context['_seq'] as $context["key"] => $context["item"]) {
  100.             // line 35
  101.             echo "                ";
  102.             $context["targetBlank"] = "";
  103.             // line 36
  104.             echo "                ";
  105.             if ((is_string($__internal_compile_0 twig_get_attribute($this->env$this->source$context["item"], "url", [], "array"falsefalsefalse36)) && is_string($__internal_compile_1 "http") && ('' === $__internal_compile_1 || === strpos($__internal_compile_0$__internal_compile_1)))) {
  106.                 // line 37
  107.                 echo "                    ";
  108.                 $context["targetBlank"] = "target=\"_blank\"";
  109.                 // line 38
  110.                 echo "                ";
  111.             }
  112.             // line 39
  113.             echo "
  114.                 <a href=\"";
  115.             // line 40
  116.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["item"], "url", [], "array"falsefalsefalse40), "html"nulltrue);
  117.             echo "\"
  118.                    class=\"story-teaser ";
  119.             // line 41
  120.             if (twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'41$this->source); })()), "inverted", [], "any"falsefalsefalse41)) {
  121.                 echo "story-teaser--inverted ";
  122.             }
  123.             echo "\"
  124.                    x-show=\"show(";
  125.             // line 42
  126.             echo twig_escape_filter($this->env$context["key"], "html"nulltrue);
  127.             echo ")\" ";
  128.             echo twig_escape_filter($this->env, (isset($context["targetBlank"]) || array_key_exists("targetBlank"$context) ? $context["targetBlank"] : (function () { throw new RuntimeError('Variable "targetBlank" does not exist.'42$this->source); })()), "html"nulltrue);
  129.             echo ">
  130.                     <div class=\"story-teaser__media\">
  131.                         ";
  132.             // line 45
  133.             echo "                        ";
  134.             if (twig_matches("/^\\d+\$/"twig_get_attribute($this->env$this->source$context["item"], "image", [], "array"falsefalsefalse45))) {
  135.                 // line 46
  136.                 echo "                            ";
  137.                 $context["image"] = $this->extensions['Sulu\Bundle\MediaBundle\Twig\MediaTwigExtension']->resolveMediaFunction(twig_get_attribute($this->env$this->source$context["item"], "image", [], "array"falsefalsefalse46), twig_get_attribute($this->env$this->sourcetwig_split_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'46$this->source); })()), "request", [], "any"falsefalsefalse46), "locale", [], "any"falsefalsefalse46), "_"), 0, [], "array"falsefalsefalse46));
  138.                 // line 47
  139.                 echo "                            <img src =\"";
  140.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'47$this->source); })()), "2880x"), "html"nulltrue);
  141.                 echo "\" class=\"story-teaser__image\"
  142.                                  srcset =\"";
  143.                 // line 48
  144.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "320x"), "html"nulltrue);
  145.                 echo " 320w, ";
  146.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "640x"), "html"nulltrue);
  147.                 echo " 640w, ";
  148.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "1280x"), "html"nulltrue);
  149.                 echo " 1280w, ";
  150.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "1440x"), "html"nulltrue);
  151.                 echo " 1440w, ";
  152.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl((isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "2048x"), "html"nulltrue);
  153.                 echo " 2048w\" alt=\"";
  154.                 echo twig_escape_filter($this->envtwig_striptags(twig_get_attribute($this->env$this->source, (isset($context["image"]) || array_key_exists("image"$context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.'48$this->source); })()), "description", [], "any"falsefalsefalse48)), "html"nulltrue);
  155.                 echo "\"
  156.                                  x-ref=\"image\" sizes=\"(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw\">
  157.                         ";
  158.             } elseif ( !twig_test_empty(twig_get_attribute($this->env$this->source,             // line 50
  159. $context["item"], "thumbnails", [], "array"falsefalsefalse50))) {
  160.                 // line 51
  161.                 echo "                            ";
  162.                 // line 52
  163.                 echo "                            <img src=\"";
  164.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "2880x"), "html"nulltrue);
  165.                 echo "\" class=\"story-teaser__image\"
  166.                                  srcset=\"";
  167.                 // line 53
  168.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "320x"), "html"nulltrue);
  169.                 echo " 320w,  ";
  170.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "640x"), "html"nulltrue);
  171.                 echo " 640w,
  172.                                          ";
  173.                 // line 54
  174.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "1280x"), "html"nulltrue);
  175.                 echo " 1280w, ";
  176.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "1440x"), "html"nulltrue);
  177.                 echo " 1440w,
  178.                                          ";
  179.                 // line 55
  180.                 echo twig_escape_filter($this->env$this->env->getRuntime('App\Twig\AppRuntime')->getThumbnailUrl($context["item"], "2048x"), "html"nulltrue);
  181.                 echo " 2048w\" alt=\"";
  182.                 echo twig_escape_filter($this->envtwig_striptags(twig_get_attribute($this->env$this->source$context["item"], "description", [], "any"falsefalsefalse55)), "html"nulltrue);
  183.                 echo "\"
  184.                                  x-ref=\"image\" sizes=\"(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw\">
  185.                         ";
  186.             }
  187.             // line 58
  188.             echo "                    </div>
  189.                     <div class=\"story-teaser__meta\">
  190.                         <span class=\"story-teaser__type\"
  191.                               style=\"float: left\">";
  192.             // line 61
  193.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["item"], "source", [], "array"falsefalsefalse61), "html"nulltrue);
  194.             echo " |&nbsp;</span>
  195.                         <span class=\"story-teaser__time\"><p>";
  196.             // line 62
  197.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["item"], "dateGerman", [], "array"falsefalsefalse62), "html"nulltrue);
  198.             echo "</span>
  199.                     </div>
  200.                     <div class=\"story-teaser__title\">
  201.                         ";
  202.             // line 66
  203.             echo twig_get_attribute($this->env$this->source$context["item"], "title", [], "array"falsefalsefalse66);
  204.             echo "
  205.                     </div>
  206.                     <div class=\"story-teaser__text\">
  207.                         ";
  208.             // line 69
  209.             echo twig_get_attribute($this->env$this->source$context["item"], "description", [], "array"falsefalsefalse69);
  210.             echo "
  211.                     </div>
  212.                 </a>
  213.             ";
  214.         }
  215.         $_parent $context['_parent'];
  216.         unset($context['_seq'], $context['_iterated'], $context['key'], $context['item'], $context['_parent'], $context['loop']);
  217.         $context array_intersect_key($context$_parent) + $_parent;
  218.         // line 73
  219.         echo "        </div>
  220.         ";
  221.         // line 76
  222.         echo "        ";
  223.         if ((twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'76$this->source); })()), "expandEnabled", [], "any"falsefalsefalse76) &&  !twig_test_empty(twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'76$this->source); })()), "newsGridExpandButtonLabel", [], "any"falsefalsefalse76)))) {
  224.             // line 77
  225.             echo "            <div class=\"teaser-grid__actions\" x-ref=\"actions\" x-show=\"showActions()\" id=\"newsgrid-actions\">
  226.                 <button class=\"button button--";
  227.             // line 78
  228.             if (twig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'78$this->source); })()), "inverted", [], "any"falsefalsefalse78)) {
  229.                 echo "grey";
  230.             } else {
  231.                 echo "default ";
  232.             }
  233.             echo "\"
  234.                         x-ref=\"loadmore\" @click=\"loadMore\" id=\"moreButton-News\">
  235. \t               <span class=\"button__inner\">
  236.                      ";
  237.             // line 81
  238.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["content"]) || array_key_exists("content"$context) ? $context["content"] : (function () { throw new RuntimeError('Variable "content" does not exist.'81$this->source); })()), "newsGridExpandButtonLabel", [], "any"falsefalsefalse81), "html"nulltrue);
  239.             echo "
  240.                    </span>
  241.                 </button>
  242.             </div>
  243.         ";
  244.         }
  245.         // line 86
  246.         echo "    </div>
  247. </div>
  248. ";
  249.         
  250.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  251.         
  252.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  253.     }
  254.     public function getTemplateName()
  255.     {
  256.         return "includes/blocks/news-grid.html.twig";
  257.     }
  258.     public function isTraitable()
  259.     {
  260.         return false;
  261.     }
  262.     public function getDebugInfo()
  263.     {
  264.         return array (  257 => 86,  249 => 81,  239 => 78,  236 => 77,  233 => 76,  229 => 73,  219 => 69,  213 => 66,  206 => 62,  202 => 61,  197 => 58,  189 => 55,  183 => 54,  177 => 53,  172 => 52,  170 => 51,  168 => 50,  153 => 48,  148 => 47,  145 => 46,  142 => 45,  135 => 42,  129 => 41,  125 => 40,  122 => 39,  119 => 38,  116 => 37,  113 => 36,  110 => 35,  106 => 34,  96 => 31,  89 => 30,  86 => 29,  82 => 27,  80 => 23,  78 => 22,  75 => 21,  73 => 20,  70 => 18,  68 => 17,  65 => 15,  63 => 14,  60 => 12,  58 => 11,  55 => 9,  53 => 8,  50 => 6,  48 => 5,  45 => 3,  43 => 2,);
  265.     }
  266.     public function getSourceContext()
  267.     {
  268.         return new Source("{# Get tags for news #}
  269. {% set tags = content.tags %}
  270. {# Get current locale #}
  271. {% set locale = app.request.locale|split('_')[0]|default('de') %}
  272. {# Get all news from database #}
  273. {% set news = news(tags) %}
  274. {# Get all smart contents from source 1 #}
  275. {% set stories = getDataFromSmartContent(content.stories, locale)|default([]) %}
  276. {# Get all smart contents from source 2 #}
  277. {% set publications = getDataFromSmartContent(content.publications, locale)|default([]) %}
  278. {# Get all smart contents from source 3 #}
  279. {% set pages = getDataFromSmartContent(content.pages, locale)|default([]) %}
  280. {# Sort by date DESC - Mix news and pages #}
  281. {% set sorted = sortByDate(stories, publications, pages, news, content.contentMixed) %}
  282. {% if (not content.expandEnabled or content.newsGridExpandButtonLabel is empty) and sorted|length > content.itemsCount %}
  283.     {#
  284.         Expanding is disabled, cut the list of items to the configured initial count
  285.         so we do not have unreachable image urls being pre-loaded
  286.     #}
  287.     {% set sorted = sorted|slice(0, content.itemsCount) %}
  288. {% endif %}
  289. <div class=\"teaser-grid {% if content.inverted %}teaser-grid--inverted {% endif %}{{ content.top }}
  290.   {{ content.bottom }}\" x-data=\"teasergrid({{ sorted|length }},{{ content.itemsCount }},3)\">
  291.     <div class=\"teaser-grid__container\">
  292.         <div class=\"teaser-grid__teasers\" x-ref=\"teasers\" id=\"teasers\">
  293.             {% for key, item in sorted %}
  294.                 {% set targetBlank = '' %}
  295.                 {% if item['url'] starts with 'http' %}
  296.                     {% set targetBlank = 'target=\"_blank\"' %}
  297.                 {% endif %}
  298.                 <a href=\"{{ item['url'] }}\"
  299.                    class=\"story-teaser {% if content.inverted %}story-teaser--inverted {% endif %}\"
  300.                    x-show=\"show({{ key }})\" {{ targetBlank }}>
  301.                     <div class=\"story-teaser__media\">
  302.                         {# Image ID from News #}
  303.                         {% if item['image'] matches '/^\\\\d+\$/' %}
  304.                             {% set image = sulu_resolve_media(item['image'], app.request.locale|split('_')[0]) %}
  305.                             <img src =\"{{ image|thumbnailUrl('2880x') }}\" class=\"story-teaser__image\"
  306.                                  srcset =\"{{ image|thumbnailUrl('320x') }} 320w, {{ image|thumbnailUrl('640x') }} 640w, {{ image|thumbnailUrl('1280x') }} 1280w, {{ image|thumbnailUrl('1440x') }} 1440w, {{ image|thumbnailUrl('2048x') }} 2048w\" alt=\"{{ image.description|striptags }}\"
  307.                                  x-ref=\"image\" sizes=\"(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw\">
  308.                         {% elseif item['thumbnails'] is not empty %}
  309.                             {# Thumbnails array from Stories #}
  310.                             <img src=\"{{ item|thumbnailUrl('2880x') }}\" class=\"story-teaser__image\"
  311.                                  srcset=\"{{ item|thumbnailUrl('320x') }} 320w,  {{ item|thumbnailUrl('640x') }} 640w,
  312.                                          {{ item|thumbnailUrl('1280x') }} 1280w, {{ item|thumbnailUrl('1440x') }} 1440w,
  313.                                          {{ item|thumbnailUrl('2048x') }} 2048w\" alt=\"{{ item.description|striptags }}\"
  314.                                  x-ref=\"image\" sizes=\"(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw\">
  315.                         {% endif %}
  316.                     </div>
  317.                     <div class=\"story-teaser__meta\">
  318.                         <span class=\"story-teaser__type\"
  319.                               style=\"float: left\">{{ item['source'] }} |&nbsp;</span>
  320.                         <span class=\"story-teaser__time\"><p>{{ item['dateGerman'] }}</span>
  321.                     </div>
  322.                     <div class=\"story-teaser__title\">
  323.                         {{ item['title']|raw }}
  324.                     </div>
  325.                     <div class=\"story-teaser__text\">
  326.                         {{ item['description']|raw }}
  327.                     </div>
  328.                 </a>
  329.             {% endfor %}
  330.         </div>
  331.         {# CSS for button and Javascript for Button required??? #}
  332.         {% if content.expandEnabled and content.newsGridExpandButtonLabel is not empty %}
  333.             <div class=\"teaser-grid__actions\" x-ref=\"actions\" x-show=\"showActions()\" id=\"newsgrid-actions\">
  334.                 <button class=\"button button--{% if content.inverted %}grey{% else %}default {% endif %}\"
  335.                         x-ref=\"loadmore\" @click=\"loadMore\" id=\"moreButton-News\">
  336. \t               <span class=\"button__inner\">
  337.                      {{ content.newsGridExpandButtonLabel }}
  338.                    </span>
  339.                 </button>
  340.             </div>
  341.         {% endif %}
  342.     </div>
  343. </div>
  344. ""includes/blocks/news-grid.html.twig""/var/www/dmz-test-pdwebsite.plan-d.cloud/templates/includes/blocks/news-grid.html.twig");
  345.     }
  346. }