<div class="sidebar section sidebar_category">
<div class="section-heading"><div class="border"></div>{{ heading_title }}</div>   
  <div class="section-block category_block">    
      <ul class="left-category treeview-list treeview">
               {% for category in categories %}
    {% if category.category_id == category_id %}
    <li class="cat-active expandable">
        <a href="{{ category.href }}" class="active">{{ category.name }}</a>
    {% else %}
    <li class="expandable">
        <a href="{{ category.href }}">{{ category.name }}</a>
        {% endif %}
        {% if category.children %}
       
         {% if category.category_id == category_id %}
              <ul class="menu-dropdown in collapsable">
                 {% else %}
         <ul class="menu-dropdown">
        {% endif %}
            {% for child in category.children %}
            
            <li>
                {% if child.category_id == child_id %}
                <a href="{{ child.href }}" class="active">{{ child.name }}</a>
               {% else %}
                <a href="{{ child.href }}">{{ child.name }}</a>
              {% endif %}
         {% if child.children %}         
         {% if category.category_id == category_id %}
              <ul class="menu-dropdown in collapsable">
                 {% else %}
         <ul class="menu-dropdown">
        {% endif %}
           {% for child_2 in child.children %}
          <li>
           {% if child_2.category_id == child2_id %}
            <a href="{{ child_2.href }}" class="active">{{ child_2.name }}</a>
            {% else %}
            <a href="{{ child_2.href }}">{{ child_2.name }}</a>
             {% endif %}
          </li>
         {% endfor %}
        </ul>
        {% endif %}
            </li>
             {% endfor %}
        </ul>
        {% endif %}
    </li>
    {% endfor %}
    </ul>
  </div>
</div>
