Commit ba6b85d9 authored by Thomas Löffler's avatar Thomas Löffler

Improve navigation rendering by not using typolink

parent 16ab7742
......@@ -60,16 +60,11 @@
<f:if condition="{settings.loginPageId} == {menuitem.data.uid}">
<f:then>
<!-- Show log in link -->
<f:link.typolink parameter="{menuitem.link}" title="{f:security.ifAuthenticated(then: 'Show login status', else: 'Login with your typo3.org user account')}" class="main-nav__list-item_link js__main-nav__list-item_link {f:if(condition: '{menuitem.data.doktype}==3', then:'externallink')}" additionalAttributes="{
data-id: '{menuitem.data.uid}',
data-level: '1',
data-sub: '{
f:if(condition: \'{menuitem.children}
|| {settings.searchPageId} == {menuitem.data.uid}
|| {settings.loginPageId} == {menuitem.data.uid}\',
then: 1,
else: 0)}'
}">
<a href="{menuitem.link}" title="{f:security.ifAuthenticated(then: 'Show login status', else: 'Login with your typo3.org user account')}" class="main-nav__list-item_link js__main-nav__list-item_link {f:if(condition: '{menuitem.data.doktype}==3', then:'externallink')}"
data-id="{menuitem.data.uid}"
data-level="1"
data-sub="{f:if(condition:'{menuitem.children} || {settings.searchPageId} == {menuitem.data.uid} || {settings.loginPageId} == {menuitem.data.uid}', then: 1, else: 0)}"
>
<span class="d-lg-none d-xl-none">{menuitem.data.title}</span>
<f:security.ifAuthenticated>
<f:then>
......@@ -77,28 +72,25 @@
<span class="sr-only">Loading...</span>
</f:then>
</f:security.ifAuthenticated>
</f:link.typolink>
</a>
</f:then>
<f:else>
<!-- Show all other links -->
<f:link.typolink
parameter="{menuitem.link}"
<a
href="{menuitem.link}"
title="Open menu for {menuitem.data.title}"
class="main-nav__list-item_link {f:if(condition: '{menuitem.data.doktype}==3', then:'externallink')} {f:if(condition: '{menuitem.children} || {settings.searchPageId} == {menuitem.data.uid}', then: 'js__main-nav__list-item_link')}"
additionalAttributes="{
data-id: '{menuitem.data.uid}',
data-level: '1',
data-sub: '{f:if(condition: \'{menuitem.children} || {settings.searchPageId} == {menuitem.data.uid} || {settings.loginPageId} == {menuitem.data.uid}\',
then: 1,
else: 0)}'
}">
data-id="{menuitem.data.uid}"
data-level="1"
data-sub="{f:if(condition:'{menuitem.children} || {settings.searchPageId} == {menuitem.data.uid} || {settings.loginPageId} == {menuitem.data.uid}', then: 1, else: 0)}"
>
<span class="{f:if(condition:'{settings.searchPageId} == {menuitem.data.uid}',then:'d-lg-none d-xl-none')}">{menuitem.data.title}</span>
</f:link.typolink>
</a>
</f:else>
</f:if>
<f:if condition="{menuitem.children}">
<f:link.typolink class="main-nav__list-item_cross js__main-nav__list-item_cross" title="{menuitem.data.description}" parameter="{menuitem.link}"> </f:link.typolink>
<a class="main-nav__list-item_cross js__main-nav__list-item_cross" title="{menuitem.data.description}" href="{menuitem.link}"> </a>
<f:render section="mobileLevel2" arguments="{_all}" />
</f:if>
</li>
......@@ -111,11 +103,11 @@
<f:for each="{menuitem.children}" as="lvl2items" iteration="lvl2i">
<li class="list-group-item sub-nav__list-item{f:if(condition: lvl2items.active, then: ' active', else: '')}">
<f:link.typolink parameter="{lvl2items.link}" title="{lvl2items.data.description}" class="sub-nav__list-item_link {f:if(condition: '{lvl2items.data.doktype}==3', then:'externallink')}">{lvl2items.title}</f:link.typolink>
<a href="{lvl2items.link}" title="{lvl2items.data.description}" class="sub-nav__list-item_link {f:if(condition: '{lvl2items.data.doktype}==3', then:'externallink')}">{lvl2items.title}</a>
<f:if condition="{lvl2items.children}">
<f:link.typolink class="main-nav__list-item_cross js__main-nav__list-item_cross" title="{lvl2items.data.description}" parameter="{lvl2items.link}">
</f:link.typolink>
<a class="main-nav__list-item_cross js__main-nav__list-item_cross" title="{lvl2items.data.description}" href="{lvl2items.link}">
</a>
<f:render section="mobileLevel3" arguments="{_all}" />
</f:if>
</li>
......@@ -127,7 +119,7 @@
<ul class="nav flex-column main-nav__list-item_sub-nav sub-nav__list js__sub-nav__list _lvl-3">
<f:for each="{lvl2items.children}" as="lvl3items" iteration="lvl3i">
<li class="sub-nav__list-item{f:if(condition: lvl3items.active, then: ' active', else: '')}">
<f:link.typolink parameter="{lvl3items.link}" class="sub-nav__list-item_link {f:if(condition: '{lvl3items.data.doktype}==3', then:'externallink')}">{lvl3items.title}</f:link.typolink>
<a href="{lvl3items.link}" class="sub-nav__list-item_link {f:if(condition: '{lvl3items.data.doktype}==3', then:'externallink')}">{lvl3items.title}</a>
</li>
</f:for>
</ul>
......@@ -166,27 +158,28 @@
<f:section name="dropdownLevel2">
<ul class="list-group sub-nav__list">
<li class="list-group-item sub-nav__list-item _overview{f:if(condition: menuitem.current, then: ' _current')}">
<f:link.typolink class="{f:if(condition: '{menuitem.data.doktype==3}', then:'externallink')}" title="{menuitem.data.description}" parameter="{menuitem.link}">
<a class="{f:if(condition: '{menuitem.data.doktype==3}', then:'externallink')}" title="{menuitem.data.description}" href="{menuitem.link}">
<span>{menuitem.title}</span>
</f:link.typolink>
</a>
</li>
<f:for each="{menuitem.children}" as="lvl2items" iteration="lvl2i" key="Lvl2Num">
<li class="list-group-item sub-nav__list-item js__sub-nav__list-item _lvl2{
f:if(condition: '{lvl2items.current}==1 && {lvl2items.active}==1', then: ' _current')}{
f:if(condition: '{lvl2items.current}==0 && {lvl2items.active}==1', then: ' _active')}">
<f:link.typolink class="sub-nav__list-item_link {f:if(condition: '{lvl2items.data.doktype}==3', then:'externallink')}" title="{lvl2items.data.description}" parameter="{lvl2items.link}">
<a class="sub-nav__list-item_link {f:if(condition: '{lvl2items.data.doktype}==3', then:'externallink')}" title="{lvl2items.data.description}" href="{lvl2items.link}">
<span>{lvl2items.title}</span>
</f:link.typolink>
</a>
<f:if condition="{lvl2items.children}">
<f:link.typolink
<a
class="sub-nav__list-item_cross js__sub-nav__list-item_cross"
title="{lvl2items.data.description}"
parameter="{lvl2items.link}"
additionalAttributes="{data-id: '{Lvl2Num}', data-level: '2'}">
href="{lvl2items.link}"
data-id="{Lvl2Num}"
data-level="2">
<span>+</span>
</f:link.typolink>
</a>
</f:if>
</li>
</f:for>
......@@ -197,7 +190,7 @@
<ul class="list-group sub-nav__list js__sub-nav__list flex-column _lvl-3{f:if(condition: '{lvl2items.current}==0 && {lvl2items.active}==1', then: ' _visible')}" data-parent-lvl2="{parentNumLvl2}">
<f:for each="{lvl2items.children}" as="lvl3items" iteration="lvl3i">
<li class="list-group-item lvl3{f:if(condition: lvl3items.current, then: ' _current')}">
<f:link.typolink class="{f:if(condition: '{lvl3items.data.doktype}==3', then:'externallink')}" parameter="{lvl3items.link}" title="{lvl3items.data.description}" additionalAttributes="{data-level: '3'}">{lvl3items.title}</f:link.typolink>
<a class="{f:if(condition: '{lvl3items.data.doktype}==3', then:'externallink')}" href="{lvl3items.link}" title="{lvl3items.data.description}" data-level="3">{lvl3items.title}</a>
</li>
</f:for>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment