Describe the bug
When utilising a default Nav Tag with include_entries="true" any entries that are unpublished are still outputted.
To Reproduce
Steps to reproduce the behavior:
Make a Nav Tag (with or without recursion) that encompasses entries, and has include_entries="true"
eg {{ nav from="/" max_depth="4" include_entries="true" }}
Set one of the entries to Unpublished
See the entry still outputted on the front-end
Expected behavior
Unless show_unpublished="true" (which is a boolean defaulted to false) is set then these entries should not be displayed
Environment details (please complete the following information):
Statamic Version 2.11.19
Fresh Instal
OS: N/A
Browser: N/A
Web Server: nginx
PHP Version: 7.3?
Addons installed: none
Additional context
Verified with a couple of users in the Statamic Discord (thanks Rob de Kort).
Is possible to manually workaround by using {{ if is_published }} and replacing the recursion loop in practice (however is still a bug when not utilising recursion):
{{ nav from="/" max_depth="4" include_entries="true" }}
<li {{ if is_current }} class="Selected" {{ /if }}>
<a href="{{ url }}">{{ title }}</a>
{{ children }}
<ul>
{{ if is_published }}
<li><a href="{{ url }}">{{ title }}</a></li>
{{ /if }}
</ul>
{{ /children }}
</li>
{{ /nav }}
Describe the bug When utilising a default Nav Tag with
include_entries="true"
any entries that are unpublished are still outputted.To Reproduce Steps to reproduce the behavior:
include_entries="true"
eg{{ nav from="/" max_depth="4" include_entries="true" }}
Expected behavior Unless
show_unpublished="true"
(which is a boolean defaulted to false) is set then these entries should not be displayedEnvironment details (please complete the following information):
Additional context Verified with a couple of users in the Statamic Discord (thanks Rob de Kort).
Is possible to manually workaround by using
{{ if is_published }}
and replacing the recursion loop in practice (however is still a bug when not utilising recursion):