[Fixed]-How to get spcific child page in django cms with {% show_menu_below_id %}?

1👍

You can do a lot when you specify a custom HTML for the menu. The template tag would be following:

{% show_menu 0 100 100 100 "menu_top.html" %}

And in the menu_top.html, you have a variable called children available for your convenience. You can use the for loop counter to determine when to insert additional HTML and split the lists or you can use other parameters of the menu items (i.e. do they have children etc.). You can even create a menu modifier and enhance the navigation tree when custom parameters are needed.

Here is an example from the Django CMS repo:

{% load menu_tags %}

{% for child in children %}
<li class="child{% if child.selected %} selected{% endif %}{% if child.ancestor %} ancestor{% endif %}{% if child.sibling %} sibling{% endif %}{% if child.descendant %} descendant{% endif %}">
    <a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">{{ child.get_menu_title }}</a>
    {% if child.children %}
    <ul>
        {% show_menu from_level to_level extra_inactive extra_active template "" "" child %}
    </ul>
    {% endif %}
</li>
{% endfor %}
👤petr

Leave a comment