<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* areas/popular-watches/view.html.twig */
class __TwigTemplate_8fd1e9fd5cf3441899f0292c27c71cdc extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "areas/popular-watches/view.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "areas/popular-watches/view.html.twig"));
// line 1
echo "<div class=\"similar-products\">
<div class=\"row\">
<div class=\"col-12 text-center\">
";
// line 4
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 4, $this->source); })())) {
// line 5
echo " ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "popular-title", ["placeholder" => "A legnépszerűbb *MODELL* órák", "class" => "article-edit-title"]);
// line 8
echo "
";
} elseif (( // line 9
array_key_exists("productList", $context) && (twig_length_filter($this->env, (isset($context["productList"]) || array_key_exists("productList", $context) ? $context["productList"] : (function () { throw new RuntimeError('Variable "productList" does not exist.', 9, $this->source); })())) > 0))) {
// line 10
echo " ";
$context["popularTitle"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "popular-title");
// line 11
echo " ";
if (((isset($context["popularTitle"]) || array_key_exists("popularTitle", $context) ? $context["popularTitle"] : (function () { throw new RuntimeError('Variable "popularTitle" does not exist.', 11, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["popularTitle"]) || array_key_exists("popularTitle", $context) ? $context["popularTitle"] : (function () { throw new RuntimeError('Variable "popularTitle" does not exist.', 11, $this->source); })()), "getText", [], "method", false, false, true, 11))) {
// line 12
echo " <h3>";
echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["popularTitle"]) || array_key_exists("popularTitle", $context) ? $context["popularTitle"] : (function () { throw new RuntimeError('Variable "popularTitle" does not exist.', 12, $this->source); })()), "render", [], "method", false, false, true, 12), 12, $this->source);
echo "</h3>
";
} else {
// line 14
echo " <h3>A legnépszerűbb órák ebben a kategóriában</h3>
";
}
// line 16
echo " ";
}
// line 17
echo " </div>
</div>
";
// line 19
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 19, $this->source); })())) {
// line 20
echo " ";
$context["options"] = ["types" => ["object"], "subtypes" => ["object" => ["object"]], "classes" => ["CoreShopProduct"], "reload" => true];
// line 28
echo " ";
$context["block"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "block", "popularwatchesblock", ["reload" => true, "limit" => 20]);
// line 32
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["block"]) || array_key_exists("block", $context) ? $context["block"] : (function () { throw new RuntimeError('Variable "block" does not exist.', 32, $this->source); })()), "iterator", [], "any", false, false, true, 32));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 33
echo " <div class=\"popular-watch-index\">
";
// line 34
$context["index"] = twig_get_attribute($this->env, $this->source, (isset($context["block"]) || array_key_exists("block", $context) ? $context["block"] : (function () { throw new RuntimeError('Variable "block" does not exist.', 34, $this->source); })()), "current", [], "any", false, false, true, 34);
// line 35
echo " ";
$context["product"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "product", $this->sandbox->ensureToStringAllowed((isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 35, $this->source); })()), 35, $this->source));
// line 36
echo " Termék ";
echo twig_escape_filter($this->env, ((isset($context["index"]) || array_key_exists("index", $context) ? $context["index"] : (function () { throw new RuntimeError('Variable "index" does not exist.', 36, $this->source); })()) + 1), "html", null, true);
echo ":
";
// line 37
echo $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 37, $this->source); })()), "render", [], "method", false, false, true, 37), 37, $this->source);
echo "
";
// line 38
if ((((isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 38, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["product"] ?? null), "element", [], "any", true, true, true, 38)) && twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 38, $this->source); })()), "element", [], "any", false, false, true, 38))) {
// line 39
echo " <div class=\"row\">
";
// line 40
echo twig_include($this->env, $context, "@CoreShopFrontend/Product/_product_item.html.twig", ["product" => twig_get_attribute($this->env, $this->source, // line 41
(isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 41, $this->source); })()), "element", [], "any", false, false, true, 41)]);
// line 42
echo "
</div>
";
}
// line 45
echo " </div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 47
echo " ";
} else {
// line 48
echo " <div class=\"row\">
";
// line 49
if ((array_key_exists("productList", $context) && (twig_length_filter($this->env, (isset($context["productList"]) || array_key_exists("productList", $context) ? $context["productList"] : (function () { throw new RuntimeError('Variable "productList" does not exist.', 49, $this->source); })())) > 0))) {
// line 50
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["productList"]) || array_key_exists("productList", $context) ? $context["productList"] : (function () { throw new RuntimeError('Variable "productList" does not exist.', 50, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 51
echo " ";
echo twig_include($this->env, $context, "@CoreShopFrontend/Product/_product_item.html.twig", ["product" => $context["item"]]);
echo "
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 53
echo " ";
}
// line 54
echo " </div>
";
}
// line 56
echo "
<div class=\"text-center\">
";
// line 58
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", "more", ["class" => "btn btn-primary"]);
// line 60
echo "
</div>
</div>";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "areas/popular-watches/view.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 210 => 60, 208 => 58, 204 => 56, 200 => 54, 197 => 53, 180 => 51, 162 => 50, 160 => 49, 157 => 48, 154 => 47, 139 => 45, 134 => 42, 132 => 41, 131 => 40, 128 => 39, 126 => 38, 122 => 37, 117 => 36, 114 => 35, 112 => 34, 109 => 33, 91 => 32, 88 => 28, 85 => 20, 83 => 19, 79 => 17, 76 => 16, 72 => 14, 66 => 12, 63 => 11, 60 => 10, 58 => 9, 55 => 8, 52 => 5, 50 => 4, 45 => 1,);
}
public function getSourceContext()
{
return new Source("<div class=\"similar-products\">
<div class=\"row\">
<div class=\"col-12 text-center\">
{% if editmode %}
{{ pimcore_input('popular-title', {
'placeholder': 'A legnépszerűbb *MODELL* órák',
'class': 'article-edit-title'
}) }}
{% elseif productList is defined and productList|length>0 %}
{% set popularTitle = pimcore_input('popular-title') %}
{% if popularTitle and popularTitle.getText() %}
<h3>{{ popularTitle.render() | raw }}</h3>
{% else %}
<h3>A legnépszerűbb órák ebben a kategóriában</h3>
{% endif %}
{% endif %}
</div>
</div>
{% if editmode %}
{% set options = {
\"types\": [\"object\"],
\"subtypes\": {
\"object\": [\"object\"]
},
\"classes\": [\"CoreShopProduct\"],
\"reload\": true
} %}
{% set block = pimcore_block('popularwatchesblock', {
'reload': true,
'limit': 20,
}) %}
{% for i in block.iterator %}
<div class=\"popular-watch-index\">
{% set index = block.current %}
{% set product = pimcore_relation('product', options) %}
Termék {{ index + 1 }}:
{{ product.render() | raw }}
{% if product and product.element is defined and product.element %}
<div class=\"row\">
{{ include('@CoreShopFrontend/Product/_product_item.html.twig', {
'product': product.element
}) }}
</div>
{% endif %}
</div>
{% endfor %}
{% else %}
<div class=\"row\">
{% if productList is defined and productList|length>0 %}
{% for item in productList %}
{{ include('@CoreShopFrontend/Product/_product_item.html.twig', {'product': item}) }}
{% endfor %}
{% endif %}
</div>
{% endif %}
<div class=\"text-center\">
{{ pimcore_link('more', {
'class': 'btn btn-primary'
}) }}
</div>
</div>", "areas/popular-watches/view.html.twig", "/home/zoltan/public_html/boutique-v2/templates/areas/popular-watches/view.html.twig");
}
public function checkSecurity()
{
static $tags = array("if" => 4, "set" => 10, "for" => 32);
static $filters = array("length" => 9, "raw" => 12, "escape" => 36);
static $functions = array("pimcore_input" => 5, "pimcore_block" => 28, "pimcore_relation" => 35, "include" => 40, "pimcore_link" => 58);
try {
$this->sandbox->checkSecurity(
['if', 'set', 'for'],
['length', 'raw', 'escape'],
['pimcore_input', 'pimcore_block', 'pimcore_relation', 'include', 'pimcore_link']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}