Skip to content

Commit

Permalink
[FEATURE] Add navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszuznanski committed Apr 7, 2024
1 parent cde670f commit 0393900
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/sites/restaurant/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,17 @@ languages:
locale: en_US.UTF-8
navigationTitle: English
flag: us
-
title: Deutsch
enabled: true
locale: de_DE
hreflang: de-DE
base: /de
websiteTitle: Restaurant
navigationTitle: ''
fallbackType: strict
fallbacks: ''
flag: de
languageId: 1
rootPageId: 1
websiteTitle: ''
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ page.10 {
dataProcessing {
10 = menu
10.as = mainNavigation

20 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor
20 {
languages = auto
as = languageNavigation
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<f:layout name="Default" />
<f:section name="Header">
<f:render partial="MainNavigation" arguments="{mainNavigation: mainNavigation}" />
<f:render partial="LanguageNavigation" arguments="{languageNavigation: languageNavigation}" />
</f:section>
<f:section name="Content">
</f:section>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ul id="language_menu" class="language-menu">
<f:for each="{languageNavigation}" as="item">
<li class="{f:if(condition: item.active, then: 'active')} {f:if(condition: item.available, else: 'text-muted')}">
<f:if condition="{item.available}">
<f:then>
<a href="{item.link}" hreflang="{item.hreflang}" title="{item.title}">
<span>{item.navigationTitle}</span>
</a>
</f:then>
<f:else>
<span>{item.navigationTitle}</span>
</f:else>
</f:if>
</li>
</f:for>
</ul>

0 comments on commit 0393900

Please sign in to comment.