Hello,
Is it possible to access the max_depth
of a collection or navigation from a template? I've dug around the docs and tried some things without success.
This pseudo-code illustrates what I'm trying to achieve:
{{ if max_depth of collection is greater than 1 }}
do something
{{ else }}
do something different
{{ /if }}
Or this (either solution would meet my needs.):
{{ if max_depth of navigation is greater than 1 }}
do something
{{ else }}
do something different
{{ /if }}
Various collections will use the same show template, but not all will have a max_depth
greater than 1
. Each collection will also have a corresponding custom navigation with the same max_depth
as its collection, which is why being able to check the value on either the collection or navigation would be sufficient. (Or maybe there's a different way to go about this.) I'm trying to avoid including a Boolean (like has_max_depth_greater_than_1
) in the Markdown file for every entry since this is a collection-level concern, not an entry-level concern.
Thanks in advance for any help!
Bruce