Skip to content

Instantly share code, notes, and snippets.

@johncarter-
Created March 16, 2021 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johncarter-/696d0bb5facf57d9bf5a2a0bd44dc636 to your computer and use it in GitHub Desktop.
Save johncarter-/696d0bb5facf57d9bf5a2a0bd44dc636 to your computer and use it in GitHub Desktop.
Statamic Bugs

Including a partial in a nav tag breaks recursive children

Using code from here: https://statamic.dev/knowledge-base/recursive-nav-examples#footer-nav-example

<div class="flex">
    {{ nav }}
        {{ if depth == 1 }}
            <div class="mx-10">
                <h3 class="mb-2">{{ title }}{{ partial:brand-svg }}</h3>{{# this partial stops the elseif depth 2 stuff rendering #}}                
                {{ if children }}
                    <ul>{{ *recursive children* }}</ul>
                {{ /if }}
            </div>
        {{ elseif depth == 2 }}
            <li class="my-1">
                <a href="{{ url }}">{{ title }}</a>
            </li>
        {{ /if }}
    {{ /nav }}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment