CMS
Banners
ButtonBlock

ButtonBlock

Different to the button object, the ButtonBlock is a standalone banner entity, that can be used independently of any other banner entities. The ButtonBlock also comes with further configuration options like size and button alignments.

Structure example

Take a look at the example on how a potential ButtonBlock can look like. The hover effect of a button on big screen devices, is always a slightly lighter color than the base color.


This example shows a primary button.
Primary button block example.
{
   "displayLink":{
      "url":"/collections/my-collection",
      "displayText":"Text",
      "descriptiveText":"My descriptive text"
   },
   "styleOptions":{
      "alignment":"center",
      "buttonType":"primary",
      "minWidth":"25%",
      "maxWidth":"100%",
      "width":"600px"
   }
}

Create

POST _apiBaseUrl/v1/cms/banner/button-block

Code

ButtonBlockDto
{
   "displayLink":{
      "url":"/collections/my-collection",
      "displayText":"Text",
      "descriptiveText":"My descriptive text"
   },
   "styleOptions":{
      "alignment":"center",
      "buttonType":"tertiary",
      "minWidth":"25%",
      "maxWidth":"100%",
      "width":"600px"
   }
}

Arguments

displayLinkrequired

A required display link. The button uses the url as link for it and the title is placed as text into it.

styleOptions

Optional style options to further customize the button block.

ButtonBlockStyleOptionsDto
alignment

Defines where the button itself should be aligned inside its parent container.

buttonType

Defines the type of button, which is used to determine what design is applied to the button.

minWidth
string|
null

Defines the min width of the button. Can be any CSS width value type. Recommended to be percentage value, to prevent overflows.

maxWidth
string|
null

Defines the max width of the button. Can be any CSS width value type. Recommended to be percentage value, to prevent overflows.

width
string|
null

Defines the base width of the button. Recommended to be a static value, like pixels.