MultiLayoutsΒΆ

/libs/granite/ui/components/foundation/layouts/multilayouts

The layout that acts as a switch to display one of many configured layouts, where the actual rendering is done.

It has the following content structure at the layout resource:

granite:LayoutsMultiLayouts
layoutstringel

The actual layout to be displayed. The resource names of available layouts are matched with the value of this property. If there is no match, then the first layout is used.

skipEmptystring
multiple

The layout names to skip rendering the empty layout. This is mainly used to delegate the empty rendering to the actual layout itself.

layouts

Each children of this resource represents the available layout to be displayed.

empty

The layout to be displayed when the item data source is empty.

The items of the layout are specified using ItemDataSource.

Example:

+ mymultilayouts
  - sling:resourceType = "granite/ui/components/foundation/container"
  + layout
    - sling:resourceType = "granite/ui/components/foundation/layouts/multilayouts"
    - layout = '${state["cq.sites.childpages.layoutId"].string}'
    + empty
      - sling:resourceType = "my/datasource"
    + layouts
      + card
        - sling:resourceType = "granite/ui/components/foundation/layouts/cardview"
        - stateId = "cq.sites.childpages"
        - layoutId = "card"
      + list
        - sling:resourceType = "granite/ui/components/foundation/layouts/listview"
        - stateId = "cq.sites.childpages"
        - layoutId = "list"
      + columns
        - sling:resourceType = "granite/ui/components/foundation/layouts/columnview"
        - stateId = "cq.sites.childpages"
        - layoutId = "columns"