<?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;
/* document/areabricks/link-brick/view.html.twig */
class __TwigTemplate_d60e5bd3c9a54a10d48af3ebb8369df7d448de11fd31dcb574d4257b506c75c5 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "document/areabricks/link-brick/view.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "document/areabricks/link-brick/view.html.twig"));
// line 1
$context["columnCount"] = ((twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "select", "columnCount"), "getData", [], "method", true, true, false, 1)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "select", "columnCount"), "getData", [], "method", false, false, false, 1), 1)) : (1));
// line 2
$context["gridClasses"] = "grid-cols-1";
// line 3
if ((((isset($context["columnCount"]) || array_key_exists("columnCount", $context) ? $context["columnCount"] : (function () { throw new RuntimeError('Variable "columnCount" does not exist.', 3, $this->source); })()) % 3) == 0)) {
// line 4
echo " ";
$context["gridClasses"] = ((isset($context["gridClasses"]) || array_key_exists("gridClasses", $context) ? $context["gridClasses"] : (function () { throw new RuntimeError('Variable "gridClasses" does not exist.', 4, $this->source); })()) . " lg:grid-cols-3");
} elseif ((( // line 5
(isset($context["columnCount"]) || array_key_exists("columnCount", $context) ? $context["columnCount"] : (function () { throw new RuntimeError('Variable "columnCount" does not exist.', 5, $this->source); })()) % 2) == 0)) {
// line 6
echo " ";
$context["gridClasses"] = ((isset($context["gridClasses"]) || array_key_exists("gridClasses", $context) ? $context["gridClasses"] : (function () { throw new RuntimeError('Variable "gridClasses" does not exist.', 6, $this->source); })()) . " lg:grid-cols-2");
}
// line 8
echo "
<div class=\"grid ";
// line 9
echo twig_escape_filter($this->env, (isset($context["gridClasses"]) || array_key_exists("gridClasses", $context) ? $context["gridClasses"] : (function () { throw new RuntimeError('Variable "gridClasses" does not exist.', 9, $this->source); })()), "html", null, true);
echo " mx-auto gap-3 py-3 px-2 bg-white\">
";
// line 10
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(range(1, (isset($context["columnCount"]) || array_key_exists("columnCount", $context) ? $context["columnCount"] : (function () { throw new RuntimeError('Variable "columnCount" does not exist.', 10, $this->source); })())));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 11
echo " <div class=\"relative h-56 overflow-hidden bg-center bg-cover md:h-64\"
";
// line 12
if ( !(isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 12, $this->source); })())) {
// line 13
echo " ";
$context["image"] = twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", ("background-" . $context["i"])), "getThumbnail", [0 => "targetaudience-background"], "method", false, false, false, 13);
// line 14
echo " style=\"background-image: url('";
echo twig_escape_filter($this->env, (isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 14, $this->source); })()), "html", null, true);
echo "');\"
href=\"#\"
";
}
// line 17
echo " >
";
// line 18
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 18, $this->source); })())) {
// line 19
echo " ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "image", ("background-" . $context["i"]), ["thumbnail" => "targetaudience-background", "class" => "w-full"]);
// line 22
echo "
";
}
// line 24
echo " ";
$context["link"] = $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "link", ("link" . $context["i"]), ["placeholder" => "Link", "class" => "flex items-center pt-1"]);
// line 28
echo "
";
// line 29
if (((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 29, $this->source); })()) || ( !(isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 29, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["link"]) || array_key_exists("link", $context) ? $context["link"] : (function () { throw new RuntimeError('Variable "link" does not exist.', 29, $this->source); })()), "text", [], "any", false, false, false, 29)))) {
// line 30
echo " <div class=\"absolute z-10 transform -translate-x-1/2 -translate-y-1/2\" style=\"top: 50%; left: 50%;\">
";
// line 31
$this->loadTemplate("component/button.html.twig", "document/areabricks/link-brick/view.html.twig", 31)->display(twig_to_array(["text" => (((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 31, $this->source); })())) ? ((isset($context["link"]) || array_key_exists("link", $context) ? $context["link"] : (function () { throw new RuntimeError('Variable "link" does not exist.', 31, $this->source); })())) : (twig_get_attribute($this->env, $this->source, (isset($context["link"]) || array_key_exists("link", $context) ? $context["link"] : (function () { throw new RuntimeError('Variable "link" does not exist.', 31, $this->source); })()), "text", [], "any", false, false, false, 31))), "type" => "primary", "icon_after" => "arrow-right-tail", "attr" => ["href" => twig_get_attribute($this->env, $this->source, (isset($context["link"]) || array_key_exists("link", $context) ? $context["link"] : (function () { throw new RuntimeError('Variable "link" does not exist.', 31, $this->source); })()), "href", [], "any", false, false, false, 31)]]));
// line 32
echo " </div>
";
}
// line 34
echo "
</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 37
echo "</div>
";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "document/areabricks/link-brick/view.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 121 => 37, 113 => 34, 109 => 32, 107 => 31, 104 => 30, 102 => 29, 99 => 28, 96 => 24, 92 => 22, 89 => 19, 87 => 18, 84 => 17, 77 => 14, 74 => 13, 72 => 12, 69 => 11, 65 => 10, 61 => 9, 58 => 8, 54 => 6, 52 => 5, 49 => 4, 47 => 3, 45 => 2, 43 => 1,);
}
public function getSourceContext()
{
return new Source("{% set columnCount = pimcore_select('columnCount').getData()|default(1) %}
{% set gridClasses = 'grid-cols-1' %}
{% if columnCount % 3 == 0 %}
{% set gridClasses = gridClasses ~ ' lg:grid-cols-3' %}
{% elseif columnCount % 2 == 0 %}
{% set gridClasses = gridClasses ~ ' lg:grid-cols-2' %}
{% endif %}
<div class=\"grid {{ gridClasses }} mx-auto gap-3 py-3 px-2 bg-white\">
{% for i in range(1, columnCount) %}
<div class=\"relative h-56 overflow-hidden bg-center bg-cover md:h-64\"
{% if not editmode %}
{% set image = pimcore_image(\"background-\" ~ i).getThumbnail('targetaudience-background') %}
style=\"background-image: url('{{ image }}');\"
href=\"#\"
{% endif %}
>
{% if editmode %}
{{ pimcore_image(\"background-\" ~ i, {
\"thumbnail\": \"targetaudience-background\",
\"class\": \"w-full\",
}) }}
{% endif %}
{% set link = pimcore_link(\"link\" ~ i, {
'placeholder': 'Link',
\"class\": \"flex items-center pt-1\",
}) %}
{% if editmode or not editmode and link.text %}
<div class=\"absolute z-10 transform -translate-x-1/2 -translate-y-1/2\" style=\"top: 50%; left: 50%;\">
{% include \"component/button.html.twig\" with { text: editmode ? link : link.text, type: \"primary\", icon_after: 'arrow-right-tail', attr: { \"href\": link.href } } only %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
", "document/areabricks/link-brick/view.html.twig", "/var/www/vhosts/3forone.ch/httpdocs/abowire/templates/document/areabricks/link-brick/view.html.twig");
}
}