undocumented Statamic strikes again. Trivial stuff like acting on the level of breadcrumb display took me a while. May be I should start deep learning antlers language… Well Claude AI did not do a good job answering that simple question, while Gemini got it right first place :
statamic antlers only display nav breadrumb if count >2
solution :
Use the as modifier to capture the breadcrumb items, and then use an if statement with the count modifier (or length modifier) to check the number of items. Claude did get the idea of assigning antlers variable to a modifier but got the wrong syntax, whbile gemini got the as modifier straight away.
<div class="bg-amber-300 flex justify-center gap-4 ">
{{ nav:breadcrumbs include_home="false" as="crumbs"}} {{ if crumbs | count >= 2}}
{{ crumbs }} <div class=" py-4 {{ if is_current }}current {{ /if }}">
<a href="{{ url }}">{{ title }}</a> {{if !last }}>{{/if}}
</div >
{{/crumbs}}{{/if}}
{{ /nav:breadcrumbs }}
</div>