Skip to content

Commit

Permalink
[TASK] update language navigation menu (#463)
Browse files Browse the repository at this point in the history
* [TASK] update language navigation menu

* [TASK] change variables for language menu
  • Loading branch information
mesosa authored and dmh committed Jan 21, 2019
1 parent 1819d93 commit 7c76272
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ lib.menu.language.standard {
defaultLanguageLabel.value = {$themes.languages.default.label}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor
10 {
special = language
special.value = 0
special.value {
override = 0,{$themes.languages.available}
override.if {
isTrue = {$themes.languages.available}
}
}
as = languages
languages = auto
as = languages
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,43 @@
<f:if condition="{languages}">
<div class="header-top__language-menu">
<f:for each="{languages}" as="language">
<f:variable name="languageFlag"><f:spaceless><f:render section="getLanguageFlag" arguments="{_all}" /></f:spaceless></f:variable>
<f:if condition="{language.active}">
<f:variable name="languageFlag"><f:spaceless><f:render section="getLanguageFlag" arguments="{_all}" /></f:spaceless></f:variable>
<f:variable name="languageLabel"><f:spaceless><f:render section="getLanguageLabel" arguments="{_all}" /></f:spaceless></f:variable>
<a class="header-top__language-menu-btn js__header-top__language-menu-btn" href="/#"><span class="main-flag-icon flag-icon flag-icon-{languageFlag}"></span><f:if condition="{theme:constant(constant:'themes.configuration.elem.status.showHeaderTopLangLabel')}">
<span class="main-flag-language flag-language">{f:translate(key:'languageMenu_label', extensionName:'theme_t3kit')}</span>
</f:if></a>
</f:if>
</f:for>
<div class="header-top__language-menu-box js__header-top__language-menu-box">
<f:for each="{languages}" as="language">
<f:variable name="languageFlag"><f:spaceless><f:render section="getLanguageFlag" arguments="{_all}" /></f:spaceless></f:variable>
<f:variable name="languageLabel"><f:spaceless><f:render section="getLanguageLabel" arguments="{_all}" /></f:spaceless></f:variable>
<f:variable name="languageFlag"><f:spaceless><f:render section="getLanguageFlag" arguments="{_all}" /></f:spaceless></f:variable>
<f:link.page addQueryString="1"
additionalParams="{L: language.languageUid}"
title="{language.label}"
additionalParams="{L: language.languageId}"
title="{language.title}"
class="header-top__language-menu-box-item{f:if(condition: language.active, then: ' active')}"
argumentsToBeExcludedFromQueryString="{0: 'id'}"><f:spaceless>
<span class="flag-icon flag-icon-{languageFlag}"></span> {languageLabel}
<span class="flag-icon flag-icon-{languageFlag}"></span> {language.navigationTitle}
</f:spaceless></f:link.page>
</f:for>
<a class="header-top__language-menu-box-close-btn js__header-top__language-menu-box-close-btn"></a>
</div>
</div>
</f:if>

<f:comment><!-- need to have current language in language variable --></f:comment>
<f:section name="getLanguageLabel">
<f:variable name="getLanguageLabel">?</f:variable>
<f:if condition="{language.languageUid} == 0">
<f:then>
<f:variable name="getLanguageLabel">{defaultLanguageLabel}</f:variable>
</f:then>
<f:else>
<f:for each="{sysLanguages}" as="sysLanguage">
<f:if condition="{sysLanguage.data.uid} == {language.languageUid}">
<f:variable name="getLanguageLabel">{sysLanguage.data.title}</f:variable>
</f:if>
</f:for>
</f:else>
</f:if>
{getLanguageLabel}
</f:section>

<f:comment><!-- need to have current language in language variable --></f:comment>
<f:section name="getLanguageFlag">
<f:variable name="getLanguageFlag">unknown</f:variable>
<f:if condition="{language.languageUid} == 0">
<f:if condition="{language.languageId} == 0">
<f:then>
<f:variable name="getLanguageFlag">{defaultLanguageFlag}</f:variable>
</f:then>
<f:else>
<f:for each="{sysLanguages}" as="sysLanguage">
<f:if condition="{sysLanguage.data.uid} == {language.languageUid}">
<f:if condition="{sysLanguage.data.uid} == {language.languageId}">
<f:variable name="getLanguageFlag">{sysLanguage.data.flag}</f:variable>
</f:if>
</f:for>
</f:else>
</f:if>
{getLanguageFlag}
</f:section>
</f:section>

0 comments on commit 7c76272

Please sign in to comment.