Attribute_layout Widget

The attribute_layout widget prints the content of a certain attribute.

This widget is only configured through layout and its sub elements and needs only a simple widget registration. The following example shows how the attributes first_name, last_name, postal_code and city can be arranged in a layout using the default width, which results in a line break after each attribute.

"layout": [{
  "id": "address",
  "layout": [
    {
      "layout": [
        {
          "attribute": "first_name"
        },
        {
          "attribute": "last_name"
        }
      ]
    },
    {
      "layout": [
        {
          "attribute": "postal_code"
        },
        {
          "attribute": "city"
        }
      ]
    }
  ]
}],
  "widgets" : {
    "address" : {
      "type" : "attribute_layout"
    }
  }

This example result in the following view of the billing address at an order, in which the grid distributes the cells automatically.