Working with the Image Viewer Web Part
The Image Viewer Web Part is responsible for the display of one product image. At minimum, this Web Part displays the main image for the product (selectable from the Property Picker if not determinable from metadata) with minimal required configuration options. For a more complex and complete method of rendering an image, or rendering multiple product images, use the Product Details Web Part or the Multi-Image Viewer Web Part.
You can select available properties to use through a pick list that is arranged to provide an HTML image property. You can supply default values for the display of the image in the absence of data from the catalog.
You can map each image property to a Microsoft Commerce Server 2009 R2 property. You click any of the buttons next to each customizable image property to enable this mapping. When you click one of the buttons, the appropriate pop-up window appears for you to select a property. You can input default settings for the image height and width.
For more flexibility with the presentation image, consider using the Product Details Web Part, which uses an XSLT template to control the image presentation.
Connecting to the Product Provider Web Part
The Image Viewer Web Part uses a Web Part connection to the Product Provider Web Part.
To connect to the Product Provider Web Part
From the Product Details page, click Site Actions,and then click Edit Page.
Click the Web Part drop-down menu and the select Edit Web Part.
Click Connections, click Get Product Provider From, and then select Product Provider Web Part.
Properties
The following table lists the properties that you can define for the Image Viewer Web Part.
Property |
Type |
Description |
Default value |
---|---|---|---|
ImageAltText |
String |
Property to which the image alternate text is mapped. |
None |
ImageFilename |
String |
Property to which the image file name is mapped. |
None |
ImageHeight |
String |
Property to which the image height is mapped. |
None |
ImageWidth |
String |
Property to which the image width is mapped. |
None |
DefaultImageAltText |
String |
Default image alternate text. |
None |
DefaultImageFilename |
String |
Default file name of the image to retrieve for display in the main display image. |
None |
DefaultImageHeight |
Integer |
Default image height. |
100 |
DefaultImageWidth |
Integer |
Default image width. |
100 |
ImageLocation |
String |
Base URL fragment representing the folder location of the catalog images from which to retrieve the image. |
None |
TableClassName |
String |
Cascading style sheet class name to apply to the table containing the main display image. |
None |
Customization
You can customize the Image Viewer Web Part by using the ImageViewerControl.ascx User control.
Note
If you customize the ASCX file, it is recommended that you make a copy of the existing ASCX file and rename the file.
Error Handling
The Image Viewer Web Part requires a product ID in the query string. When a product ID is not found, the Web site provides the shopper with a message in the place of the image.
API Dependencies
There are no API dependencies for this Web Part, although it does interact with the Product Query Web Part.
See Also
Other Resources
Developing with SharePoint Commerce Services
Developing with Catalog Web Parts