{% load mptt_tags %}
<html>
<head><title>Welcome to $STORE!</title></head>
<body>
Current filter is {{filter}}
{% if filter %}
{% drilldown_tree_for_node tree as breadcrumbs %}
{% recursetree breadcrumbs %} {% if not node.is_leaf_node %} {{ node.name }} >> {% endif %} {% endrecursetree %}
{% endif %}
<ul class="root">
    {% recursetree tree %}
        <li>
            <a href="/filter/{% if filter %}{{filter}},{% endif %}fandom={{ node.id }}">{{ node.name }}</a>
            {% if not node.is_leaf_node %}
                <ul class="children">
                    {{ children }}
                </ul>
            {% endif %}
        </li>
    {% endrecursetree %}
</ul>
</body>
</html>

{% load mptt_tags %}
<html>
<head><title>Welcome to $STORE!</title></head>
<body>
Current filter is {{filter}}
{% if tree %}
{% if filter %}
{% drilldown_tree_for_node tree as breadcrumbs %}
{% recursetree breadcrumbs %} {% if not node.is_leaf_node %} {{ node.name }} >> {% endif %} {% endrecursetree %}
{% endif %}
{% endif %}
<ul class="root">
    {% recursetree tree %}
        <li>
            <a href="/filter/{% if filter %}{{filter}},{% endif %}fandom={{ node.id }}">{{ node.name }}</a>
            {% if not node.is_leaf_node %}
                <ul class="children">
                    {{ children }}
                </ul>
            {% endif %}
        </li>
    {% endrecursetree %}
</ul>
</body>
</html>

Check for tree before using it
Check for tree before using it
