CMS
Banners
GridWrapper

GridWrapper

A GridWrapper is a wrapper banner that only servers the purpose to allow other so called 'Nestable banners' to wrap each other next to each other. This way banners can be placed in a row next to each other and break out from the default column styling.

A GridWrapper can als be wrapped inside another GridWrapper, allowing for an infinite amount of recursive nesting inside of it.

GridWrapper can also be utilized as some sort of section banner, since the background of the wrapper can be changed by either setting on or multiple images as background images or just simply setting a fixed color. If the items in the grid should not be displayed in several rows, the base width of a row can be set to 100% as this sets the row to full size, preventing any other rows next to it to be present.

Structure examples

Take a look at some examples, to further understand the possibilities, of how a GridWrapper can be wrapped.


This example shows a possible version of a simple GridWrapper version, with two equivalently sized grid items.
Simple grid wrapper example.
{
   "columns":[
      {
         "basis":"350px",
         "banners":[
            {
               "__typename":"ImageBlock",
               "id":"my-image-block-id"
            }
         ]
      },
      {
         "basis":"350px",
         "banners":[
            {
               "__typename":"TextBlock",
               "id":"my-text-block-id"
            },
            {
               "__typename":"TextBlock",
               "id":"my-text-block-id-2"
            },
            {
               "__typename":"ButtonBlock",
               "id":"my-button-block-id"
            },
            {
               "__typename":"TextBlock",
               "id":"my-text-block-id-3"
            }
         ]
      }
   ],
   "styleOptions":{
      "invertOrderMobile":true
      "background":null
   }
}

Create

POST _apiBaseUrl/v1/cms/banner/grid-wrapper

Code

CreateGridWrapperDto
{
   "columns":[
      {
         "basis":"220px",
         "banners":[
            {
               "__typename":"ImageBlock",
               "id":"my-image-block"
            }
         ]
      },
      {
         "basis":"220px",
         "banners":[
            {
               "__typename":"TextBlock",
               "id":"my-text-block"
            },
            {
               "__typename":"TextBlock",
               "id":"my-text-block-2"
            }
         ]
      }
   ],
   "styleOptions":{
      "invertOrderMobile":false,
      "background":null
   }
}

Arguments

columnsrequired

A list of all columns rendered inside the grid wrapper.

GridWrapperColumnDto
basis
string
required

The basis for that column. Defines its min width of it and the ratio, depending on the value of the other columns. E.g. two columns with 250px would be equal in size, where one 100px and one 200px column basis would result in one column being 66% of the size of the whole grid wrapper.

bannersrequired

A list of all banners that are rendered inside this column. The grid wrapper allows recursive structure, hence you can also wrap a new grid wrapper element inside of the column. Banners inside a column are displayed vertically below each other.

The banners are loosely connect, based on their id to the grid wrapper column.

styleOptions

Optional style options to further customize the grid wrapper.

GridWrapperStyleOptionsDto
invertOrderMobile
boolean|
null

Setting that inverts the order of the columns of the grid on mobile. This is useful for banners with two rows, where one row is text and the other is an image and on mobile the text would be above the image. With this setting the image would be ordered before the text on mobile.

background

Optional setting to add a background of any kind to the whole grid wrapper container.

BackgroundImageDto

An array of background images that are layered above each other as background for the grid wrapper container.

fallbackColor
string
required

The color that is displayed while the background image is still loading. The color is also visible, when the background has transparent parts. Furthermore can only a simple colored background be shown, when the images attribute is set to null, while a fallbackColor is set.