add visible option for menu

This commit is contained in:
L3D 2021-02-18 19:19:38 +01:00
parent af38935b88
commit fa5bbc8b89
No known key found for this signature in database
GPG Key ID: CD08445BFF4313D1
3 changed files with 18 additions and 8 deletions

View File

@ -1,7 +1,11 @@
{ {
"Leistungen": { "Leistungen": {
"href": "/leistungen", "href": "/leistungen",
"items": {} "list_childs": true,
"items": {
"Kunden": "/kunden",
"Partner": "/partner"
}
}, },
"Mitglieder": { "Mitglieder": {
"href": "/mitglieder", "href": "/mitglieder",
@ -11,16 +15,18 @@
"Charta": "/mitglieder/charta" "Charta": "/mitglieder/charta"
} }
}, },
"Kunden": { "Aktuelles": {
"href": "/kunden", "href": "/blog",
"items": {} "visible": false,
}, "list_childs": true,
"Partner": {
"href": "/partner",
"items": {} "items": {}
}, },
"Kontakt": { "Kontakt": {
"href": "/kontakt", "href": "/kontakt",
"items": {} "list_childs": true,
"items": {
"Impressum": "/impressum",
"Datenschutz": "/datenschutz"
}
} }
} }

View File

@ -32,6 +32,7 @@
<ul class="primary_nav__navlist"> <ul class="primary_nav__navlist">
{% for title, mapping in bag("navigation").items() %} {% for title, mapping in bag("navigation").items() %}
{% if mapping.visible|default(true) %}
<li class="primary_nav__navitem <li class="primary_nav__navitem
{%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %} {%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %}
-active -active
@ -56,6 +57,7 @@
</ul> </ul>
{% endif %} {% endif %}
</li> </li>
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -36,6 +36,7 @@
<ul class="primary_nav__navlist"> <ul class="primary_nav__navlist">
{% for title, mapping in bag("navigation").items() %} {% for title, mapping in bag("navigation").items() %}
{% if mapping.visible|default(true) %}
<li class="primary_nav__navitem <li class="primary_nav__navitem
{%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %} {%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %}
-active -active
@ -60,6 +61,7 @@
</ul> </ul>
{% endif %} {% endif %}
</li> </li>
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>