Discussions

Ask a Question
Back to All

page.slug with nav

What's the best way to create a page nav in a layout to show only the child pages of which ever page the layout is applied to?

Have tried the following and it doesn't work.

{% nav page.slug %}

{% nav 'page.slug' %}

{% assign nav_name = page.slug %}
{% nav nav_name %}

When trying the actual page slug as a string, it works as desired.