# Django-Html filtering

**URL:** <https://forum.djangoproject.com/t/django-html-filtering/5629>\
**Category:** Using Django\
**Created:** [December 9, 2020, 1:43pm UTC](https://forum.djangoproject.com/t/django-html-filtering/5629 "2020-12-09T13:43:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![safakatar38](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/safakatar38/32/2738_2.png) [@safakatar38](https://forum.djangoproject.com/u/safakatar38)\
**Post date:** [December 9, 2020, 1:43pm UTC](https://forum.djangoproject.com/t/django-html-filtering/5629/1 "2020-12-09T13:43:10Z")

</div>

Hello again, in my project i have a problem. I want to do filtering operation in html page but they dont accept my final if code. I think my problem is little bit complicated so here is my codes:  
(My goal is making navbar who can be controlled on admin page(sql) for example i’ve product button on navbar and it will have 4 sub category and 4 sub category will have more than 5 subcartegory)

```
                    {% if BigProductKinds %}
                      {% for bpk in BigProductKinds %}
                        <div (somecodes)>
                      <div class="mb-5 font-weight-bold">{{bpk.Name}}</div>
                      <ul class="list-styled mb-0 font-size-sm">
                      {% for lpk in littleproductkinds %}
                      **{% if bpk.id = lpk.Ust_Kategori %}** ---> problem here
                      <!-- Links -->
                        <li class="list-styled-item">
                          <a class="list-styled-link" href="somepage">{{lpk.Name}}</a>
                        </li>
                      **{% endif %}**
                      {% endfor %}
                      </ul>                      
                    </div>
                      {% endfor %}
                    {% else %}
```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 9, 2020, 5:02pm UTC](https://forum.djangoproject.com/t/django-html-filtering/5629/2 "2020-12-09T17:02:09Z")

</div>

Take another look at the [`if` template tag](https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#if) and the [boolean operators](https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#boolean-operators).
