Skip to main content

Web2PrintArtworkAttributeController

You get this controller when useAttribute(...) resolves a Web2Print artwork attribute. An artwork attribute is backed by value entities that each carry print material metadata; you select one by its cid.

import { useAttribute } from "@expivi/product-configurator";

const attribute = useAttribute(configurator, attributeCid);

Selecting an artwork

Pass the value entity's cid to setValue(...). The controller copies the entity's material metadata into the configured value.

const artwork = attribute.allValues[0];
attribute.setValue(artwork.cid);

API

This controller adds no new public members. Its type-specific behavior lives in the overridden setValue(...)/parse(...):

  • setValue(cid) selects the artwork value entity whose cid matches and carries its material metadata into the configured value: materialId, materialName, and sku (alongside the shared value).
  • parse(data) restores the selection by matching the first serialized value's id against the available artwork values.

For all other members, see the Common Attribute API.