AEM Content & Commerce Authoring provides a set of authoring tools to help AEM authors and marketers efficiently work with commerce product data and catalogs. The Product Picker and Category Picker are part of CIF add-on and used by the CIF Core Components. Projects can use these pickers in any component dialog to select products or categories.
To use the product picker in a project component, a developer must add commerce/gui/components/common/cifproductfield
to a component dialog. For example, use the following for the cq:dialog:
<product jcr:primaryType="nt:unstructured"
sling:resourceType="commerce/gui/components/common/cifproductfield"
fieldDescription="The product or product variant displayed by the teaser"
fieldLabel="Select Product"
filter="folderOrProductOrVariant"
name="./selection"
selectionId="sku"/>
The product field allows navigation to the product that a user wants to select by way of the different views. By default the product field returns the ID of the product, but it can be configured using the selectionId
attribute.
The product picker field supports the following optional properties:
Also, standard dialog field properties like name
, fieldLabel
, or fieldDescription
, are supported, as well.
The cifproductfield
component requires the cif.shell.picker
clientlib. To add a clientlib to a dialog, you can use the extraClientlibs property.
Starting with CIF Core Components version 2.0.0 the support for id
was removed and replaced with uid
. Adobe recommends using sku
or slug
as product identifier. Adobe continues to support id
only for projects using CIF Core Components version 1.x.
A full working example of the cifproductfield
can be found in the CIF Core Components project. See also Customizing Dialogs of the AEM Core Components documentation.
The category picker can be used in a component dialog as well in a similar way like the product picker.
The following snippet can be used in a cq:dialog configuration:
<category jcr:primaryType="nt:unstructured"
sling:resourceType="commerce/gui/components/common/cifcategoryfield"
fieldLabel="Category"
name="./categoryId"
selectionId="uid" />
The category picker field supports the following optional properties:
Also, standard dialog field properties like name
, fieldLabel
, or fieldDescription
are supported as well.
Same as the cifproductfield
component the cifcategoryfield
component also requires the cif.shell.picker
clientlib. To add a clientlib to a dialog, you can use the extraClientlibs
property. See Customizing Dialogs of the AEM Core Components documentation.
Starting with CIF Core Components version 2.0.0 the support for id
was removed and replaced with uid
. Adobe recommends using uid
or urlPath
as category identifier. Adobe continues to support id
& idAndUrlPath
only for projects using CIF Core Components version 1.x.
A full working example of the cifcategoryfield
can be found in the CIF Core Components project.