<?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;
/* default/snippet/carousel.twig */
class __TwigTemplate_03055e21cfd792327682fd0b14aade36 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
'css' => [$this, 'block_css'],
];
$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", "default/snippet/carousel.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "default/snippet/carousel.twig"));
// line 1
$context["randomId"] = ("swiper_" . twig_random($this->env));
// line 2
echo "
";
// line 3
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 3, $this->source); })())) {
// line 4
echo " <div class=\"container\">
<h1>SeikoClub carousel szerkesztő</h1>
";
// line 6
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "block", "carouselblock"), "iterator", [], "any", false, false, true, 6));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 7
echo " <div style=\"background: #fff; padding: 20px;\">
<p>Link:<br>";
// line 8
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", "link", ["required" => "linkonly"]);
// line 10
echo "</p>
<p>Kép (1920x1200px):<br>";
// line 11
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", "image");
echo "</p>
<h2>";
// line 12
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "subline", ["placeholder" => "Szöveg 1. sor"]);
echo "</h2>
<h1>";
// line 13
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "textarea", "headerline", ["placeholder" => "Szöveg 2. sor"]);
echo "</h1>
<hr>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 17
echo " </div>
";
} else {
// line 19
echo " <section id=\"homepage-slider\" class=\"position-relative\">
<div class=\"container\">
<div class=\"swiper-container homepage-slider ";
// line 21
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 21, $this->source); })()), 21, $this->source), "html", null, true);
echo "\">
<div class=\"swiper-wrapper\">
";
// line 23
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "block", "carouselblock"), "iterator", [], "any", false, false, true, 23));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 24
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", "link"), "getHref", [], "method", false, false, true, 24), 24, $this->source), "html", null, true);
echo "\" class=\"swiper-slide bg\"
style=\"background: url('";
// line 25
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", "image"), "getSrc", [], "method", false, false, true, 25), 25, $this->source), "html", null, true);
echo "')\">
<div class=\"content\">
<div>
";
// line 28
if ( !twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "subline"), "isEmpty", [], "method", false, false, true, 28)) {
// line 29
echo " <p>";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "subline"), "getData", [], "method", false, false, true, 29), 29, $this->source), "html", null, true);
echo "</p>
";
}
// line 31
echo " ";
if ( !twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "textarea", "headerline"), "isEmpty", [], "method", false, false, true, 31)) {
// line 32
echo " <h2>";
echo twig_nl2br(twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "textarea", "headerline"), "getData", [], "method", false, false, true, 32), 32, $this->source), "html", null, true));
echo "</h2>
";
}
// line 34
echo " </div>
</div>
</a>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 38
echo " </div>
<div class=\"swiper-pagination\"></div>
<div class=\"swiper-button-prev\"></div>
<div class=\"swiper-button-next\"></div>
</div>
</div>
</section>
";
// line 46
twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_script')->getCallable()(), "appendFile", ["https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js"], "method", false, false, true, 46);
// line 47
echo "
";
// line 48
twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_script')->getCallable()(), "captureStart", ["APPEND"], "method", false, false, true, 48);
// line 49
echo " const swiper_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 49, $this->source); })()), 49, $this->source), "html", null, true);
echo " = new Swiper('.";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 49, $this->source); })()), 49, $this->source), "html", null, true);
echo "', {
// Optional parameters
direction: 'horizontal',
loop: true,
slidesPerView: 1,
// If we need pagination
pagination: {
el: '.";
// line 57
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 57, $this->source); })()), 57, $this->source), "html", null, true);
echo " .swiper-pagination',
},
// Navigation arrows
navigation: {
nextEl: '.";
// line 62
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 62, $this->source); })()), 62, $this->source), "html", null, true);
echo " .swiper-button-next',
prevEl: '.";
// line 63
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["randomId"]) || array_key_exists("randomId", $context) ? $context["randomId"] : (function () { throw new RuntimeError('Variable "randomId" does not exist.', 63, $this->source); })()), 63, $this->source), "html", null, true);
echo " .swiper-button-prev',
},
});
";
// line 66
twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_script')->getCallable()(), "captureEnd", [], "method", false, false, true, 66);
// line 67
echo "
";
// line 68
$this->displayBlock('css', $context, $blocks);
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function block_css($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(), "block", "css"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "css"));
// line 69
echo " ";
twig_get_attribute($this->env, $this->source, $this->env->getFunction('pimcore_head_link')->getCallable()(), "appendStylesheet", ["https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"], "method", false, false, true, 69);
// line 70
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "default/snippet/carousel.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 218 => 70, 215 => 69, 195 => 68, 192 => 67, 190 => 66, 184 => 63, 180 => 62, 172 => 57, 158 => 49, 156 => 48, 153 => 47, 151 => 46, 141 => 38, 132 => 34, 126 => 32, 123 => 31, 117 => 29, 115 => 28, 109 => 25, 104 => 24, 100 => 23, 95 => 21, 91 => 19, 87 => 17, 77 => 13, 73 => 12, 69 => 11, 66 => 10, 64 => 8, 61 => 7, 57 => 6, 53 => 4, 51 => 3, 48 => 2, 46 => 1,);
}
public function getSourceContext()
{
return new Source("{% set randomId = 'swiper_' ~ random() %}
{% if editmode %}
<div class=\"container\">
<h1>SeikoClub carousel szerkesztő</h1>
{% for i in pimcore_block('carouselblock').iterator %}
<div style=\"background: #fff; padding: 20px;\">
<p>Link:<br>{{ pimcore_link('link', {
'required': 'linkonly'
}) }}</p>
<p>Kép (1920x1200px):<br>{{ pimcore_image('image') }}</p>
<h2>{{ pimcore_input('subline', {'placeholder': 'Szöveg 1. sor'}) }}</h2>
<h1>{{ pimcore_textarea('headerline', {'placeholder': 'Szöveg 2. sor'}) }}</h1>
<hr>
</div>
{% endfor %}
</div>
{% else %}
<section id=\"homepage-slider\" class=\"position-relative\">
<div class=\"container\">
<div class=\"swiper-container homepage-slider {{ randomId }}\">
<div class=\"swiper-wrapper\">
{% for i in pimcore_block('carouselblock').iterator %}
<a href=\"{{ pimcore_link('link').getHref() }}\" class=\"swiper-slide bg\"
style=\"background: url('{{ pimcore_image('image').getSrc() }}')\">
<div class=\"content\">
<div>
{% if not pimcore_input('subline').isEmpty() %}
<p>{{ pimcore_input('subline').getData() }}</p>
{% endif %}
{% if not pimcore_textarea('headerline').isEmpty() %}
<h2>{{ pimcore_textarea('headerline').getData() | nl2br }}</h2>
{% endif %}
</div>
</div>
</a>
{% endfor %}
</div>
<div class=\"swiper-pagination\"></div>
<div class=\"swiper-button-prev\"></div>
<div class=\"swiper-button-next\"></div>
</div>
</div>
</section>
{% do pimcore_head_script().appendFile('https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js') %}
{% do pimcore_head_script().captureStart('APPEND') %}
const swiper_{{ randomId }} = new Swiper('.{{ randomId }}', {
// Optional parameters
direction: 'horizontal',
loop: true,
slidesPerView: 1,
// If we need pagination
pagination: {
el: '.{{ randomId }} .swiper-pagination',
},
// Navigation arrows
navigation: {
nextEl: '.{{ randomId }} .swiper-button-next',
prevEl: '.{{ randomId }} .swiper-button-prev',
},
});
{% do pimcore_head_script().captureEnd() %}
{% block css %}
{% do pimcore_head_link().appendStylesheet('https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css') %}
{% endblock %}
{% endif %}", "default/snippet/carousel.twig", "/home/zoltan/public_html/boutique-v2/templates/default/snippet/carousel.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 1, "if" => 3, "for" => 6, "do" => 46, "block" => 68);
static $filters = array("escape" => 21, "nl2br" => 32);
static $functions = array("random" => 1, "pimcore_block" => 6, "pimcore_link" => 8, "pimcore_image" => 11, "pimcore_input" => 12, "pimcore_textarea" => 13, "pimcore_head_script" => 46, "pimcore_head_link" => 69);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for', 'do', 'block'],
['escape', 'nl2br'],
['random', 'pimcore_block', 'pimcore_link', 'pimcore_image', 'pimcore_input', 'pimcore_textarea', 'pimcore_head_script', 'pimcore_head_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;
}
}
}