Initialize a Region with a Component Already Populated
Prepopulating a region with default components is a best practice that guides a
merchant in creating a page. To specify that a region contains specific components by default,
use the default_component_constructors
property in the meta definition file for
a page type. You can also use this property in the meta definition file for a component type
that includes a region. When the merchant creates a page in the Visual Editor using the page
type or component type, the default components are already populated in the region. The merchant
can delete the components if necessary.
The following example specifies that the main region of the page is prepopulated with a
default component. The component has id commerce_layouts.productDetail
and
name Product Detail Layout
.
{
"name":"Product Detail Page",
"description":"Product detail page with 3 regions",
"region_definitions":[
{
"id":"top",
"name":"Top Region",
"component_type_exclusions": [{ "type_id": "commerce_assets.campaignBanner" }]
},
{
"id":"main",
"name":"Main Region",
"default_component_constructors": [
{ "type_id": "commerce_layouts.productDetail", "name": "Product Detail Layout"}
],
"component_type_exclusions": [{ "type_id": "commerce_assets.campaignBanner" }]
},
{
"id":"bottom",
"name":"Bottom Region",
"component_type_exclusions": [{ "type_id": "commerce_assets.campaignBanner" }]
}
],
"supported_aspect_types": ["pdp"]
}