{#}
<?php
/**
* @var $contacts array
* @var $this \Pimcore\Templating\PhpEngine
*/
$document = $this->document;
if(!$document instanceof \Pimcore\Model\Document\Page) {
$document = \Pimcore\Model\Document\Page::getById(21);
}
$lang = 'de'; //$document->getProperty('language');
$langSwitch = $lang === 'de' ? 'EN' : 'DE';
$href = $lang === 'de' ? '/en' : '/de';
?>
#}
{% set alternateLanguagePath = document.getProperty('alternateLanguagePath') %}
{% set lang = document.getProperty('language') %}
{% if lang == 'en' %}
{% set otherLang = 'de' %}
{% else %}
{% set otherLang = 'en' %}
{% endif %}
<script>
function changeLang(language) {
Cookies.set('language', language, {expires: 14});
{% if alternateLanguagePath %}
const fullUrl = '{{ app.request.getSchemeAndHttpHost() ~ alternateLanguagePath.getFullPath() }}';
window.location.assign(fullUrl);
{% else %}
let urlPath = "{{ app.request.requestUri() | replace({'/en/': '/', '/de/': '/'}) }}";
if(urlPath == '/en') {
urlPath = '';
}
const dePage = '{{ app.request.getSchemeAndHttpHost() }}' + urlPath;
const enPage = '{{ startseiteEN }}' + urlPath;
window.location.assign(language == 'de' ? dePage : enPage);
{% endif %}
}
</script>
<div class="menue-wrapper">
<div class="inline-wrapper">
<div style="display: flex; align-items: center; justify-content: center;" class="icon">
<p style="margin-bottom: 0; display: flex; text-transform: uppercase;"><span>{{ lang }}</span>/<span onclick="changeLang('{{ otherLang }}')" style="cursor: pointer;">{{ otherLang }}</span></p>
</div>
{% for item in contacts %}
<div class="icon">{{ item | raw }}</div>
{% endfor %}
<div class="icon search">
{{ include('includes/side-navigation/search-form.html.twig') }}
</div>
<div class="icon">
<a href="{{ wetterLink }}" >
<img class="wetter-img" width="45" height="45" src="{{ wetterIcon }}" alt=""/>
</a>
</div>
<div style="width: 25px; height: 25px; margin-right: 0;" class="icon">
{{ include('includes/side-navigation/burger.html.twig') }}
</div>
</div>
</div>