Drupal Layout API Icon Maps

In der YAML-Datei, die die Konfiguration für Layouts bereitstellt, gibt es eine coole Funktion für die Vorschau des Layouts. Das ganz nennt sich Icon Map und funktioniert ganz wunderbar.

Image
Layout Icon Maps

Um verschiedene zweispaltige Layouts zu hinterlegen brauchen wir zunächst mal Regionen.

  regions:
    top:
      label: Top
    first:
      label: First
    second:
      label: Second
    bottom:
      label: Bottom

Für die erste Variante sieht die Icon Map so aus:

  icon_map:
    - [top]
    - [first, second, second]
    - [bottom]

 Variante 2

  icon_map:
    - [top]
    - [first, first, second]
    - [bottom]

Und zwei gleich breite Icons

  icon_map:
    - [top]
    - [first, second]
    - [bottom]

Eine Region nimmt automatisch 100% Breite. Mit anderen Region zusammen teilt sich das 50/50 auf und kommt eine Region zwei mal vor, dann wird sie kombiniert. Bestechend einfach.