Legal menu

Information

Folder
src/components/template-components/footer/legal-menu

Files

Schema
// src/components/template-components/footer/legal-menu/schema.yaml

$schema: http://json-schema.org/draft-07/schema
$id: /template-components/footer/legal-menu
additionalProperties: false
properties:
  links:
    type: array
    items:
      type: object
      properties:
        url:
          type: string
          format: uri-reference
        label:
          type: string
        on_click:
          type: string
      required:
        - label
  tracking_class:
    type: string
required:
  - links
Mocks
// src/components/template-components/footer/legal-menu/mocks.yaml

links:
  - label: Sitemap
    url: url
  - label: Datenschutzeinstellungen anpassen
    on_click: UC_UI.showSecondLayer();
  - label: Datenschutz
    url: url
  - label: Impressum
    url: url
Template
// src/components/template-components/footer/legal-menu/legal-menu.html.twig

<ul class="LegalMenu{% if class %} {{ class }}{% endif %} u-typo-copy-small">
  {% for item in links %}
    <li class="LegalMenu-item">
      <{% if item.url %}a href="{{ item.url }}" {% else %}button type="button" {% endif %}class="LegalMenu-itemLink{% if tracking_class %} {{ tracking_class }}{% endif %}"{% if item.on_click %} onclick="{{ item.on_click }}"{% endif %}>{{ item.label }}</{% if item.url %}a{% else %}button{% endif %}>
    </li>
  {% endfor %}
</ul>

Variants

default
Open