{namespace neos=Neos\Neos\ViewHelpers}
{namespace meta=Newland\NeosMetaTags\ViewHelpers}

<div class="o-container">
    <f:if condition="{items}">
        <nav class="c-breadcrumb" aria-labelledby="{node.identifier}">
            <h2 id="{node.identifier}" class="visually-hidden">
                Breadcrumb Navigation
            </h2>

            <ul class="c-breadcrumb__list">
                <f:for each="{items}" as="item" reverse="TRUE" iteration="i">
                    <li class="c-breadcrumb__item">
                        <f:if condition="{i.cycle} == 1">
                            <f:then>
                                <a href="/">
                                    Startseite
                                </a>
                                <svg class="c-icon">
                                    <use xlink:href="#icon-angle-right"></use>
                                </svg>
                            </f:then>
                            <f:else>
                                <f:if condition="{item.state} == 'current' && {i.cycle} != 1">
                                    <f:then>
                                        <a aria-current="page">
                                            {item.label}
                                        </a>
                                    </f:then>
                                    <f:else>
                                        {neos:link.node(node: item.node)}
                                    </f:else>
                                </f:if>
                                <f:if condition="!{i.isLast}">
                                    <svg class="c-icon">
                                        <use xlink:href="#icon-angle-right"></use>
                                    </svg>
                                </f:if>
                            </f:else>
                        </f:if>
                    </li>
                </f:for>
            </ul>
        </nav>
    </f:if>
</div>
