2

Hello guys I am really thinking hard on this one I need help. How do I put the django-mptt in a nested dropdown. the recursetree tag when I put it in a bootstrap dropdown it comes out all jumbled up.

        {% load mptt_tags %}
        <ul>
            {% recursetree category_list %}
                <li>
                   {{ node.name}}</a>
                {% if not node.is_leaf_node %}
                    <ul class="children">
                        <a href="{% url 'category_detail' id=node.id %}">
                  {{ children | lower}}</a>
                    </ul>
                {% endif %}
             </li>
           {% endrecursetree %}
    </ul>
  • How deep is the tree nested? – dahrens Jan 06 '18 at 23:39
  • well the tree is 4 levels – user6771817 Jan 07 '18 at 00:08
  • looks ok - according to [the docs](https://django-mptt.github.io/django-mptt/templates.html#recursetree) - can you please describe / illustrate how it is jumbled up? – dahrens Jan 07 '18 at 00:22
  • Sorry 4 such late reply my intension was to use it in a nested dropdown. ( a dropdown inside a dropdown. ) Category -> subcategory -> sub subcategory something like that. – user6771817 Jan 07 '18 at 09:34
  • You told that you put it into bootstrap dropdown - but your example is just plain django mptt recursetree example - can you please show us what you have tried regarding the bootstrap dropdown? – dahrens Jan 07 '18 at 10:38
  • I've solved the issue will post the solution soon thanks for trying to help though. noticed bootstrap doesn't do nested dropdown. – user6771817 Jan 07 '18 at 23:19

0 Answers0