Describe the bug
When using the nav tag with include_entries='true' it shows the entire mounted collection, including unpublished items. I'm trying to use the tag as a sitemap for the site, but don't want the draft blog posts to appear in the list.
To Reproduce
Using the code below in a template is how I produced this.
<ul class="no-links sitemap">
{{ nav from="/" include_entries="true" show_unpublished="false" }}
<li>
<a href="{{ url }}" class="inline-block">{{ title }}</a>
{{ if children }}
<ul class="">{{ *recursive children* }}</ul>
{{ /if }}
</li>
{{ /nav }}
</ul>
Expected behavior
The nav tag already filters our unpublished pages by default. At least in my use case, it should take the value from show_unpublished and use it recursively as well.
Environment details (please complete the following information):
Statamic Version: 2.11.19
Fresh Install or Upgrade: Fresh Install
OS: macOS 10.15.3
Browser: Firebox
Web Server: Valet Locally, Nginx Production
PHP Version: 7.3
Addons installed: Aardvark Seo, PowerTools, Spock
Additional context
I can remedy this issue by wrapping the whole inside of the nav tag with {{ if is_published }}, but there might be an underlying issue, so I wanted to report what I'd found.
Describe the bug When using the
nav
tag withinclude_entries='true'
it shows the entire mounted collection, including unpublished items. I'm trying to use the tag as a sitemap for the site, but don't want the draft blog posts to appear in the list.To Reproduce Using the code below in a template is how I produced this.
Expected behavior The
nav
tag already filters our unpublished pages by default. At least in my use case, it should take the value fromshow_unpublished
and use it recursively as well.Environment details (please complete the following information):
Additional context I can remedy this issue by wrapping the whole inside of the
nav
tag with{{ if is_published }}
, but there might be an underlying issue, so I wanted to report what I'd found.