How to configure Primary Image attribute

Prev Next

You can configure an attribute to set an image as the primary image or as the thumbnail of a product in the Assets tab of PDP. Upon configuring, you can view the Mark as Primary or Unmark as Primary icon by hovering over the linked assets in the Tile view. For more information, see Assets.

Note: By default, the Primary Image configuration is disabled in the application.

Sample JSON configuration

Sample JSON to configure the Primary Image attribute.

{
  "metaInfo": {
    "dataIndex": "config",
    "collectionName": "configObjects",
    "responseObjectName": "response"
  },
  "configObjects": [
    {
      "id": "rock-entity-relationship-search-result-v2_hasimages_isPrimary_commerceUXConfig",
      "name": "rock-entity-relationship-search-result-v2_hasimages_isPrimary",
      "type": "commerceUXConfig",
      "data": {
        "contexts": [
          {
            "context": {
              "component": " rock-entity-relationship-search-result-v2",
              "relationship": "hasimages",
              "role": "_DEFAULT"
            },
            "jsonData": {
              "config": {
                "gridConfig": {
                  "isPrimaryAttribute": "isprimary"
                }
              }
            }
          }
        ]
      }
    }
  ]
}

To configure primary image attribute:

  1. Download the attached JSON file.

rock-entity-relationship-search-result-v2_hasimages_isPrimary_commerceUXConfig
854 Byte
  1. Open the rock-entity-relationship-search-result-v2_hasimages_isPrimary_commerceUXConfig.json file and specify the following:

Parameters

Details

context

component

Specify the name of the component to be configured.

relationship

Specify the relationship name for which the component is to be configured, else _ DEFAULT.

role

Specify the role for which the component is to be configured, else _DEFAULT.

Note: By default, _DEFAULT is specified for role, which implies the component is configured for all roles and users.

config

Specify the following.

isPrimaryAttribute

Specify the attribute name that must be configured for the primary image.

  1. Upload the JSON configuration file in the Classic UI. For more information, see How to upload UI Configurations.

    In the Assets tab, you can view the Mark as Primary or Unmark as Primary icon by hovering over the linked assets in the Tile view.
    ui-configurations-pdp-assets-primary-image.png