Skip to content

Instantly share code, notes, and snippets.

@NathanQ
Created November 8, 2016 22:52
Show Gist options
  • Save NathanQ/4285e7a72dc71d91ecefb8c13f85f6c2 to your computer and use it in GitHub Desktop.
Save NathanQ/4285e7a72dc71d91ecefb8c13f85f6c2 to your computer and use it in GitHub Desktop.
The example nav is an unordered list for a max of 2 levels of nesting for ExpressionEngine Taxonomy plugin
<ul class="navbar-collapse bs-navbar-collapse collapse" role="navigation">
{exp:taxonomy:nav
tree_id="2"
display_root="no"
style="linear"
}
<li{if node_has_children} class="has-dropdown"{/if}>
<a href="{node_url}"
{if target_blank} target="_blank"{/if}
{if title_attribute} title="{title_attribute}"{/if}
{if node_has_children} id="drop{node_level_count}" class="dropdown-toggle" data-toggle="dropdown"{/if}>
{node_title}
{if node_has_children}<b class="caret"></b>{/if}
</a>
{if node_has_children}
<ul class="dropdown" role="menu" aria-labelledby="drop{node_level_count}">
{children}
</ul>
{/if}
</li>
{/exp:taxonomy:nav}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment