Change the URL of nav child entry conditionally I want to change the URL of a li from a nav menu conditionally (using a custom field where the user sets the URL), but I don't see how to use conditionals with {% ifchildren %}?

{% nav entry in entries %}
    &lt;li&gt;
        &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;

        {% if entry.id in craft.entries.descendantOf(4).ids() %}
            **change the url of all child entries**
        {% endif %}

        {% ifchildren %}
            &lt;ul class="menu sub-items"&gt;
                {% children %}
            &lt;/ul&gt;
        {% endifchildren %}
    &lt;/li&gt;
{% endnav %}


ID 4's children is the entry which I want to display custom URLs.
Instead of using {% ifchildren %} use {% if entry.hasDescendants %}. It allows for more flexibility in your nav templating.