var/cache/dev/twig/43/431d99c795c72eceddbcfaf1df766652.php line 81

Open in your IDE?
  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. /* content/thumbnails.html.twig */
  14. class __TwigTemplate_dbbe060755de0253f4f4259b361bafb7 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->blocks = [
  23.             'content' => [$this'block_content'],
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $this->checkSecurity();
  27.     }
  28.     protected function doGetParent(array $context)
  29.     {
  30.         // line 1
  31.         return "layouts/layout.html.twig";
  32.     }
  33.     protected function doDisplay(array $context, array $blocks = [])
  34.     {
  35.         $macros $this->macros;
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""content/thumbnails.html.twig"));
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""content/thumbnails.html.twig"));
  40.         $this->parent $this->loadTemplate("layouts/layout.html.twig""content/thumbnails.html.twig"1);
  41.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  42.         
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  44.         
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  46.     }
  47.     // line 3
  48.     public function block_content($context, array $blocks = [])
  49.     {
  50.         $macros $this->macros;
  51.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  53.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  55.         // line 4
  56.         echo "
  57.     <div id=\"main-content\" class=\"main-content\" >
  58.         ";
  59.         // line 7
  60.         echo twig_include($this->env$context"includes/content-headline.html.twig");
  61.         echo "
  62.         ";
  63.         // line 10
  64.         echo "        ";
  65.         $context["image"] = ((twig_get_attribute($this->env$this->source$this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"image""image"), "getImage", [], "method"falsefalsetrue10)) ?: (Pimcore\Model\Asset::getById(341)));
  66.         // line 11
  67.         echo "
  68.         <p>
  69.             ";
  70.         // line 14
  71.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Original Dimensions of the Image:"), "html"nulltrue);
  72.         echo "
  73.             ";
  74.         // line 15
  75.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(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.'15$this->source); })()), "width", [], "any"falsefalsetrue15), 15$this->source), "html"nulltrue);
  76.         echo " x ";
  77.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(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.'15$this->source); })()), "height", [], "any"falsefalsetrue15), 15$this->source), "html"nulltrue);
  78.         echo "
  79.         </p>
  80.         <div class=\"mb-5\">
  81.             ";
  82.         // line 19
  83.         echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"image""image", ["thumbnail" => "content""imgAttributes" => ["class" => "img-responsive"]]);
  84.         echo "
  85.         </div>
  86.         ";
  87.         // line 23
  88.         $context["thumbnails"] = ["Cover" => "exampleCover""Contain" => "exampleContain""Frame" => "exampleFrame""Rotate" => "exampleRotate""Resize" => "exampleResize""Scale by Width" => "exampleScaleWidth""Scale by Height" => "exampleScaleHeight""Contain & Overlay" => "exampleOverlay""Rounded Corners" => "exampleCorners""Colors" => "exampleColor""Sepia" => "exampleSepia""Grayscale" => "exampleGrayscale""Mask" => "exampleMask""Combined 1" => "exampleCombined1""Combined 2" => "exampleCombined2"];
  89.         // line 40
  90.         echo "
  91.         <section class=\"thumbnail-examples\">
  92.             ";
  93.         // line 44
  94.         $context['_parent'] = $context;
  95.         $context['_seq'] = twig_ensure_traversable((isset($context["thumbnails"]) || array_key_exists("thumbnails"$context) ? $context["thumbnails"] : (function () { throw new RuntimeError('Variable "thumbnails" does not exist.'44$this->source); })()));
  96.         $context['loop'] = [
  97.           'parent' => $context['_parent'],
  98.           'index0' => 0,
  99.           'index'  => 1,
  100.           'first'  => true,
  101.         ];
  102.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  103.             $length count($context['_seq']);
  104.             $context['loop']['revindex0'] = $length 1;
  105.             $context['loop']['revindex'] = $length;
  106.             $context['loop']['length'] = $length;
  107.             $context['loop']['last'] = === $length;
  108.         }
  109.         foreach ($context['_seq'] as $context["title"] => $context["name"]) {
  110.             // line 45
  111.             echo "
  112.                 ";
  113.             // line 46
  114.             if (((twig_get_attribute($this->env$this->source$context["loop"], "index0", [], "any"falsefalsetrue46) % 3) == 0)) {
  115.                 // line 47
  116.                 echo "                    <div class=\"row\">
  117.                 ";
  118.             }
  119.             // line 49
  120.             echo "
  121.                 <div class=\"col-lg-4\">
  122.                     ";
  123.             // line 51
  124.             $context["thumbnail"] = 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.'51$this->source); })()), "getThumbnail", [$context["name"]], "method"falsefalsetrue51);
  125.             // line 52
  126.             echo "
  127.                     <div class=\"img-container\">
  128.                         ";
  129.             // line 54
  130.             echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["thumbnail"]) || array_key_exists("thumbnail"$context) ? $context["thumbnail"] : (function () { throw new RuntimeError('Variable "thumbnail" does not exist.'54$this->source); })()), "getHTML", [], "method"falsefalsetrue54), 54$this->source);
  131.             echo "
  132.                     </div>
  133.                     <h5>";
  134.             // line 57
  135.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["title"], 57$this->source)), "html"nulltrue);
  136.             echo "</h5>
  137.                     <div class=\"img-dimensions\">
  138.                         ";
  139.             // line 60
  140.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Dimensions:"), "html"nulltrue);
  141.             echo "
  142.                         ";
  143.             // line 61
  144.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["thumbnail"]) || array_key_exists("thumbnail"$context) ? $context["thumbnail"] : (function () { throw new RuntimeError('Variable "thumbnail" does not exist.'61$this->source); })()), "width", [], "any"falsefalsetrue61), 61$this->source), "html"nulltrue);
  145.             echo " x ";
  146.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["thumbnail"]) || array_key_exists("thumbnail"$context) ? $context["thumbnail"] : (function () { throw new RuntimeError('Variable "thumbnail" does not exist.'61$this->source); })()), "height", [], "any"falsefalsetrue61), 61$this->source), "html"nulltrue);
  147.             echo "
  148.                     </div>
  149.                 </div>
  150.                 ";
  151.             // line 65
  152.             if ((twig_get_attribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsetrue65) || (((twig_get_attribute($this->env$this->source$context["loop"], "index0", [], "any"falsefalsetrue65) + 1) % 3) == 0))) {
  153.                 // line 66
  154.                 echo "                    </div>
  155.                 ";
  156.             }
  157.             // line 68
  158.             echo "            ";
  159.             ++$context['loop']['index0'];
  160.             ++$context['loop']['index'];
  161.             $context['loop']['first'] = false;
  162.             if (isset($context['loop']['length'])) {
  163.                 --$context['loop']['revindex0'];
  164.                 --$context['loop']['revindex'];
  165.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  166.             }
  167.         }
  168.         $_parent $context['_parent'];
  169.         unset($context['_seq'], $context['_iterated'], $context['title'], $context['name'], $context['_parent'], $context['loop']);
  170.         $context array_intersect_key($context$_parent) + $_parent;
  171.         // line 69
  172.         echo "        </section>
  173.     </div>
  174.     ";
  175.         // line 73
  176.         echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context"areablock""content_bottom");
  177.         echo "
  178. ";
  179.         
  180.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  181.         
  182.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  183.     }
  184.     /**
  185.      * @codeCoverageIgnore
  186.      */
  187.     public function getTemplateName()
  188.     {
  189.         return "content/thumbnails.html.twig";
  190.     }
  191.     /**
  192.      * @codeCoverageIgnore
  193.      */
  194.     public function isTraitable()
  195.     {
  196.         return false;
  197.     }
  198.     /**
  199.      * @codeCoverageIgnore
  200.      */
  201.     public function getDebugInfo()
  202.     {
  203.         return array (  203 => 73,  197 => 69,  183 => 68,  179 => 66,  177 => 65,  168 => 61,  164 => 60,  158 => 57,  152 => 54,  148 => 52,  146 => 51,  142 => 49,  138 => 47,  136 => 46,  133 => 45,  116 => 44,  110 => 40,  108 => 23,  101 => 19,  92 => 15,  88 => 14,  83 => 11,  80 => 10,  75 => 7,  70 => 4,  60 => 3,  37 => 1,);
  204.     }
  205.     public function getSourceContext()
  206.     {
  207.         return new Source("{% extends 'layouts/layout.html.twig' %}
  208. {% block content %}
  209.     <div id=\"main-content\" class=\"main-content\" >
  210.         {{ include('includes/content-headline.html.twig') }}
  211.         {# this is just used for demonstration #}
  212.         {% set image =  pimcore_image('image').getImage() ?: pimcore_asset(341) %}
  213.         <p>
  214.             {{ 'Original Dimensions of the Image:'|trans }}
  215.             {{ image.width }} x {{ image.height }}
  216.         </p>
  217.         <div class=\"mb-5\">
  218.             {{ pimcore_image('image', { thumbnail: 'content', imgAttributes: {class: 'img-responsive'}}) }}
  219.         </div>
  220.         {% set thumbnails = {
  221.             'Cover': 'exampleCover',
  222.             'Contain': 'exampleContain',
  223.             'Frame': 'exampleFrame',
  224.             'Rotate': 'exampleRotate',
  225.             'Resize': 'exampleResize',
  226.             'Scale by Width': 'exampleScaleWidth',
  227.             'Scale by Height': 'exampleScaleHeight',
  228.             'Contain & Overlay': 'exampleOverlay',
  229.             'Rounded Corners': 'exampleCorners',
  230.             'Colors': 'exampleColor',
  231.             'Sepia': 'exampleSepia',
  232.             'Grayscale': 'exampleGrayscale',
  233.             'Mask': 'exampleMask',
  234.             'Combined 1': 'exampleCombined1',
  235.             'Combined 2': 'exampleCombined2'
  236.         } %}
  237.         <section class=\"thumbnail-examples\">
  238.             {% for title, name in thumbnails %}
  239.                 {% if loop.index0 % 3 == 0 %}
  240.                     <div class=\"row\">
  241.                 {% endif %}
  242.                 <div class=\"col-lg-4\">
  243.                     {% set thumbnail = image.getThumbnail(name) %}
  244.                     <div class=\"img-container\">
  245.                         {{ thumbnail.getHTML()|raw }}
  246.                     </div>
  247.                     <h5>{{ title|trans }}</h5>
  248.                     <div class=\"img-dimensions\">
  249.                         {{ 'Dimensions:'|trans }}
  250.                         {{ thumbnail.width }} x {{ thumbnail.height }}
  251.                     </div>
  252.                 </div>
  253.                 {% if loop.last or ((loop.index0 + 1) % 3 == 0) %}
  254.                     </div>
  255.                 {% endif %}
  256.             {% endfor %}
  257.         </section>
  258.     </div>
  259.     {{ pimcore_areablock('content_bottom') }}
  260. {% endblock %}
  261. ""content/thumbnails.html.twig""/var/www/dev-10/templates/content/thumbnails.html.twig");
  262.     }
  263.     
  264.     public function checkSecurity()
  265.     {
  266.         static $tags = array("set" => 10"for" => 44"if" => 46);
  267.         static $filters = array("escape" => 14"trans" => 14"raw" => 54);
  268.         static $functions = array("include" => 7"pimcore_image" => 10"pimcore_asset" => 10"pimcore_areablock" => 73);
  269.         try {
  270.             $this->sandbox->checkSecurity(
  271.                 ['set''for''if'],
  272.                 ['escape''trans''raw'],
  273.                 ['include''pimcore_image''pimcore_asset''pimcore_areablock']
  274.             );
  275.         } catch (SecurityError $e) {
  276.             $e->setSourceContext($this->source);
  277.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  278.                 $e->setTemplateLine($tags[$e->getTagName()]);
  279.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  280.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  281.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  282.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  283.             }
  284.             throw $e;
  285.         }
  286.     }
  287. }