View Types
Use view types to group images according to usage context, for example, by the image's size.
First, define a list of view types in the context of a catalog. When you create a new catalog (via the Business Manager or import), the catalog automatically contains the following default view types:
viewtype | Description |
---|---|
large | Large images shown on the storefronts product detail page |
medium | Small images shown on the storefronts search result page |
small | Very small images used to hover over to show the related detail image. |
swatch | Images used to differentiate variation products, for example, based on the variation attribute "color" (Swatches are based on variation products.) |
View types:
- A view type is a
String id
, with an optional name. - View types must be unique per catalog.
- You must have at least one view type to be able to assign images.
- You can assign multiple view types to an image.
- Multiple images assigned to a view type can
be viewed as a stack. The first image in the stack is assigned the
virtual index number 0; the second is assigned the virtual index number
1, and so on.
- You can't explicitly set an index number.
- You can't place an unassigned index number between assigned index numbers.
You can establish a relationship between different view types by ordering the view type image stacks. With this approach, related images have the same position (index number) within the stack. For example, small for hover help and large for the product detail page, represent the same picture but are sized differently.
- You don't need to use all view types for every product.
- You can add a secondary image variation attribute, such as color. This enables you to specify an image for a combination of product attributes, for example, to show an image in view type large for red leather.