<?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;

/* property/index-type */
class __TwigTemplate_912d2ea46649ad25fceaa2eaa6e797a7 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "layouts/_main";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("template", "property/index-type");
        $this->parent = $this->loadTemplate("layouts/_main", "property/index-type", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
        craft\helpers\Template::endProfile("template", "property/index-type");
    }

    // line 3
    public function block_content($context, array $blocks = [])
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("block", "content");
        // line 4
        echo "
  <div class=\"section mt-5\">
    <div class=\"container mt-4\">
      <div class=\"row mb-5 align-items-center\">
        <div class=\"col-lg-6 text-center mx-auto\">
          <h2 class=\"font-weight-bold text-primary heading\">
            Category Filtering Property
          </h2>
          <h5>
             ";
        // line 13
        $context["requestedSlug"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 13, $this->source); })()), "app", []), "request", []), "getSegment", [0 => 3], "method");
        // line 14
        echo "


             ";
        // line 17
        $context["category"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 17, $this->source); })()), "categories", [], "method"), "slug", [0 =>         // line 18
(isset($context["requestedSlug"]) || array_key_exists("requestedSlug", $context) ? $context["requestedSlug"] : (function () { throw new RuntimeError('Variable "requestedSlug" does not exist.', 18, $this->source); })())], "method"), "one", [], "method");
        // line 20
        echo "             ";
        echo twig_escape_filter($this->env, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 20, $this->source); })()), "title", []), "html", null, true);
        echo "   
            
          </h5>

          ";
        // line 24
        $context["myCategoryQuery"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 24, $this->source); })()), "categories", [], "method"), "group", [0 => "propertyType"], "method");
        // line 26
        echo "
          ";
        // line 28
        echo "          ";
        $context["cats"] = craft\helpers\Template::attribute($this->env, $this->source, (isset($context["myCategoryQuery"]) || array_key_exists("myCategoryQuery", $context) ? $context["myCategoryQuery"] : (function () { throw new RuntimeError('Variable "myCategoryQuery" does not exist.', 28, $this->source); })()), "all", [], "method");
        // line 29
        echo "
          <ul class=\"nav nav-pills\">
            ";
        if (isset($context['nav'])) {
            $_nav = $context['nav'];
        }
        // line 31
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["cats"]) || array_key_exists("cats", $context) ? $context["cats"] : (function () { throw new RuntimeError('Variable "cats" does not exist.', 31, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["cat"]) {
            $_thisItemLevel = (int)craft\helpers\Template::attribute($this->env, $this->getSourceContext(), $context["cat"], 'level', [], Twig\Template::ANY_CALL, false, true);
            $_thisItemLft = (int)craft\helpers\Template::attribute($this->env, $this->getSourceContext(), $context["cat"], 'lft', [], Twig\Template::ANY_CALL, false, true);
            $_thisItemRgt = (int)craft\helpers\Template::attribute($this->env, $this->getSourceContext(), $context["cat"], 'rgt', [], Twig\Template::ANY_CALL, false, true);
            if (isset($_contextsByLevel)) {
                if (
                    $_thisItemLevel > $context['nav']['level'] + 1 ||
                    (isset($_contextsByLevel[$_thisItemLevel-1]['nav']['rgt']) && $_thisItemLft > $_contextsByLevel[$_thisItemLevel-1]['nav']['rgt'])
                ) {
                    continue;
                }
                $_tmpContext = $context;
                $context = $_contextsByLevel[$context['nav']['level']];
                if ($_thisItemLevel > $context['nav']['level']) {
                    for ($_i = $context['nav']['level']; $_i < $_thisItemLevel; $_i++) {
                    }
                } else {
                    if ($_thisItemLevel < $context['nav']['level']) {
                        for ($_i = $context['nav']['level']-1; $_i >= $_thisItemLevel; $_i--) {
                            if (isset($_contextsByLevel[$_i])) {
                                $context = $_contextsByLevel[$_i];
                                unset($_contextsByLevel[$_i]);
                            }
                        }
                    }
                }
                $context = $_tmpContext;
                unset($_tmpContext);
            } else {
                $_firstItemLevel = $_thisItemLevel;
            }
            $context['nav'] = [
                'level' => $_thisItemLevel,
                'lft' => $_thisItemLft,
                'rgt' => $_thisItemRgt,
            ];
            if (isset($_contextsByLevel[$_thisItemLevel-1])) {
                $context['nav']['parent'] = $_contextsByLevel[$_thisItemLevel-1];
                if (method_exists($context["cat"], 'setParent')) {
                    $context["cat"]->setParent($context['nav']['parent']["cat"]);
                }
            } else {
                $context['nav']['parent'] = null;
            }
            $_contextsByLevel[$_thisItemLevel] = $context;
            // line 32
            echo "            <li class=\"px-2\">
              <a class=\"btn btn-grey btn-sm\" style='background: #ccc;
                border-radius: 10px;
                padding: 10px 15px' 
aria-current=\"page\" href=\"";
            // line 36
            echo twig_escape_filter($this->env, craft\helpers\UrlHelper::url(("property/index-type/" . craft\helpers\Template::attribute($this->env, $this->source, $context["cat"], "slug", []))), "html", null, true);
            echo "\">";
            echo twig_escape_filter($this->env, craft\helpers\Template::attribute($this->env, $this->source, $context["cat"], "title", []), "html", null, true);
            echo "</a>
            </li>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cat'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        if (isset($_thisItemLevel)) {
            $_tmpContext = $context;
            if ($_thisItemLevel > $_firstItemLevel) {
                for ($_i = $_thisItemLevel; $_i > $_firstItemLevel; $_i--) {
                    if (isset($_contextsByLevel[$_i])) {
                        $context = $_contextsByLevel[$_i];
                                                                    }
                }
            }
            $context = $_contextsByLevel[$_firstItemLevel];
            $context = $_tmpContext;
            unset($_thisItemLevel, $_firstItemLevel, $_i, $_contextsByLevel, $_tmpContext);
        }
        if (isset($_nav)) {
            $context['nav'] = $_nav;
            unset($_nav);
        }
        // line 39
        echo "          </ul>

        </div>
      </div>

        <div class=\"row\">
          <div class=\"col-12\">
            <div class=\"property-slider-wrap\">
              <div class=\"property-slider\">

                <!-- .item -->
                ";
        // line 50
        $context["array"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 50, $this->source); })()), "entries", []), "section", [0 => "property"], "method"), "relatedTo", [0 => (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 50, $this->source); })())], "method"), "all", [], "method");
        // line 53
        echo "
                ";
        // line 54
        $context["transform"] = true;
        // line 55
        echo "                ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["array"]) || array_key_exists("array", $context) ? $context["array"] : (function () { throw new RuntimeError('Variable "array" does not exist.', 55, $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 56
            echo "

                  ";
            // line 58
            $this->loadTemplate("property/_single", "property/index-type", 58)->display(twig_array_merge($context, ["item" =>             // line 59
$context["item"], "transform" =>             // line 60
(isset($context["transform"]) || array_key_exists("transform", $context) ? $context["transform"] : (function () { throw new RuntimeError('Variable "transform" does not exist.', 60, $this->source); })())]));
            // line 62
            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 63
        echo "                <!-- .item -->
              </div>

              <div
                id=\"property-nav\"
                class=\"controls\"
                tabindex=\"0\"
                aria-label=\"Carousel Navigation\"
              >
                <span
                  class=\"prev\"
                  data-controls=\"prev\"
                  aria-controls=\"property\"
                  tabindex=\"-1\"
                  >Prev</span
                >
                <span
                  class=\"next\"
                  data-controls=\"next\"
                  aria-controls=\"property\"
                  tabindex=\"-1\"
                  >Next</span
                >
              </div>
            </div>
          </div>
        </div>


    </div>
  </div>

";
        craft\helpers\Template::endProfile("block", "content");
    }

    public function getTemplateName()
    {
        return "property/index-type";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  239 => 63,  225 => 62,  223 => 60,  222 => 59,  221 => 58,  217 => 56,  199 => 55,  197 => 54,  194 => 53,  192 => 50,  179 => 39,  151 => 36,  145 => 32,  97 => 31,  90 => 29,  87 => 28,  84 => 26,  82 => 24,  74 => 20,  72 => 18,  71 => 17,  66 => 14,  64 => 13,  53 => 4,  48 => 3,  35 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% extends 'layouts/_main' %}

{% block content %}

  <div class=\"section mt-5\">
    <div class=\"container mt-4\">
      <div class=\"row mb-5 align-items-center\">
        <div class=\"col-lg-6 text-center mx-auto\">
          <h2 class=\"font-weight-bold text-primary heading\">
            Category Filtering Property
          </h2>
          <h5>
             {% set requestedSlug = craft.app.request.getSegment(3) %}



             {% set category = craft.categories()
                              .slug(requestedSlug)
                              .one() %}
             {{ category.title }}   
            
          </h5>

          {% set myCategoryQuery = craft.categories()
                  .group('propertyType') %}

          {# Fetch the categories #}
          {% set cats = myCategoryQuery.all() %}

          <ul class=\"nav nav-pills\">
            {% nav cat in cats %}
            <li class=\"px-2\">
              <a class=\"btn btn-grey btn-sm\" style='background: #ccc;
                border-radius: 10px;
                padding: 10px 15px' 
aria-current=\"page\" href=\"{{ url('property/index-type/' ~ cat.slug)}}\">{{ cat.title}}</a>
            </li>
            {% endnav %}
          </ul>

        </div>
      </div>

        <div class=\"row\">
          <div class=\"col-12\">
            <div class=\"property-slider-wrap\">
              <div class=\"property-slider\">

                <!-- .item -->
                {% set array = craft.entries.section('property').relatedTo(category).all()

                %}

                {% set transform = true %}
                {% for item in array %}


                  {% include 'property/_single' with {
                    item: item,
                    transform: transform 
                  } %}
                {% endfor %}
                <!-- .item -->
              </div>

              <div
                id=\"property-nav\"
                class=\"controls\"
                tabindex=\"0\"
                aria-label=\"Carousel Navigation\"
              >
                <span
                  class=\"prev\"
                  data-controls=\"prev\"
                  aria-controls=\"property\"
                  tabindex=\"-1\"
                  >Prev</span
                >
                <span
                  class=\"next\"
                  data-controls=\"next\"
                  aria-controls=\"property\"
                  tabindex=\"-1\"
                  >Next</span
                >
              </div>
            </div>
          </div>
        </div>


    </div>
  </div>

{% endblock %}", "property/index-type", "/home/addons/atweb.space/sub/craft-demo/cms/templates/property/index-type.twig");
    }
}
