feat: optional additional link to main site in topnav

This commit is contained in:
Björn Fromme
2025-01-06 17:59:33 +01:00
parent 6536ac5114
commit 9374b97fe3
4 changed files with 23 additions and 9 deletions
@@ -22,6 +22,8 @@ plugin.tx_eptheme {
footerNavPid =
# cat=eptheme/200/130; type=string; label=Default homepage UID
defaultHomeUid =
# cat=eptheme/200/131; type=string; label=Main site PID
mainSitePid =
# cat=eptheme/200/135; type=string; label=Link to apply to logo (overrides defaultHomeUid)
logoLink =
# cat=eptheme/200/140; type=string; label=Default page UID for ajax requests
@@ -30,6 +30,7 @@ plugin.tx_eptheme {
teaserTextMaxChars = {$plugin.tx_eptheme.settings.teaserTextMaxChars}
faqPageUid = {$plugin.tx_eptheme.settings.faqPageUid}
defaultHomeUid = {$plugin.tx_eptheme.settings.defaultHomeUid}
mainSitePid = {$plugin.tx_eptheme.settings.mainSitePid}
logoLink = {$plugin.tx_eptheme.settings.logoLink}
defaultAjaxUid = {$plugin.tx_eptheme.settings.defaultAjaxUid}
defaultContactFormPageUid = {$plugin.tx_eptheme.settings.defaultContactFormPageUid}
@@ -3,10 +3,10 @@
}
.topnav__nav {
@apply flex justify-between m-0 p-0 w-full;
@apply flex items-center justify-between m-0 p-0 w-full divide-x divide-white/50 border-l border-r border-white/50;
}
.topnav__item {
@apply flex items-center justify-center w-16 h-8 text-white hover:text-white focus:text-white hover:bg-ep-secondary border-l border-r border-white/50;
@apply flex items-center justify-center w-16 h-8 text-white hover:text-white focus:text-white hover:bg-ep-secondary;
@apply ser:hover:bg-ser-secondary;
}
@@ -8,11 +8,22 @@
<div class="topnav">
<div class="container">
<nav role="navigation" class="topnav__nav">
<f:link.typolink parameter="{settings.defaultHomeUid}" class="topnav__item" title="E&amp;P">
{ep:icon(icon: 'home', class: 'w-5 h-5')}
</f:link.typolink>
<f:if condition="{settings.topNavPid}">
<div class="flex-1 flex items-center divide-x divide-white/50">
<div class="flex items-center divide-x divide-white/50">
<f:if condition="{settings.mainSitePid}">
<f:link.typolink parameter="{settings.mainSitePid}"
class="topnav__item"
title="{settings.defaultTitle}">
<f:image src="EXT:ep_theme/Resources/Public/images/logo.svg"
class="h-5 w-auto"
alt="{settings.defaultTitle}"/>
</f:link.typolink>
</f:if>
<f:link.typolink parameter="{settings.defaultHomeUid}" class="topnav__item" title="E&amp;P">
{ep:icon(icon: 'home', class: 'w-5 h-5')}
</f:link.typolink>
</div>
<div class="flex-1 flex items-center divide-x divide-white/50">
<f:if condition="{settings.topNavPid}">
<f:for each="{topnav}" as="menuitem">
<a class="topnav__item flex-grow{f:if(condition: menuitem.data.tx_eptheme_navitemclass, then: ' {menuitem.data.tx_eptheme_navitemclass}')}{f:if(condition: '{menuitem.active} or {menuitem.data.uid} == {settings.forceActiveTopnavUid}', then: ' bg-ep-secondary')}"
href="{menuitem.link}"{f:if(condition: '{menuitem.data.doktype} == 3', then: ' target="_blank"')}
@@ -20,8 +31,8 @@
{menuitem.title}
</a>
</f:for>
</div>
</f:if>
</f:if>
</div>
<f:if condition="{settings.myEpPageUid}">
<f:link.typolink parameter="{settings.myEpPageUid}" class="topnav__item" title="My E&P">
{ep:icon(icon: 'user', class: 'w-5 h-5')}