{namespace neos=Neos\Neos\ViewHelpers}
<f:render section="itemList" arguments="{items: items}" />
<f:section name="itemList">
	<ul class="neos-nav neos-nav-list">
		<f:for each="{items}" as="item">
			<li class="neos-{item.state}">
				<neos:link.node node="{item.node}" />
				<f:if condition="{item.subItems}">
					<f:render section="subList" arguments="{items: item.subItems}" />
				</f:if>
			</li>
		</f:for>
	</ul>
</f:section>

<f:section name="subList">
	<ul>
		<f:for each="{items}" as="item">
			<li class="neos-{item.state}">
				<neos:link.node node="{item.node}" />
				<f:if condition="{item.subItems}">
					<f:render section="subList" arguments="{items: item.subItems}"/>
				</f:if>
			</li>
		</f:for>
	</ul>
</f:section>
