View Source

{toc}

h2. What is vcGetProductImages?

vcGetProductImages is a snippet that gets the image(s) from a VisionCart product and displays them using a chunk or config-file (included in the theme)



h2. Examples

These 2 examples you can use in the getProduct snippet config/chunk \[\[+id\]\] is the id of the product.


Start with the first image (&offset=`0`) and stop there (&limit=`1`) where image prefix is medium\_
{code:lang=javascript}[[!vcGetProductImages?id=`[[+id]]`&offset=`0`&limit=`1`&prefix=`medium_`]]{code}


Get all images for this product skipping the first image where prefix is thumb\_
{code}[[!vcGetProductImages?id=`[[+id]]`&offset=`1`&prefix=`thumb_`]]{code}
You can also use the snippet as a standalone snippet setting the id by hand but then a shopId must also be set.
{code}[[!vcGetProductImages?id=`10`&offset=`0`&limit=`1`&prefix=`thumb_`&shopId=`1`]]
{code}

h2. Available Properties

h3. Templating Properties

|| Name || Description \\ || Default Value \\ ||
| tpl \\ | Name of a chunk serving as the image template. If not provided,default theme is used \\ | |

h3. Selection Properties

|| Name \\ || Description \\ || Default Value ||
| rel \\ | Value for placeholder "rel" used in tpl \\ | |
| limit \\ | Limits the number of images returned | 0 \\ |
| offset \\ | An offset of images returned by the criteria to skip | 0 \\ |
| prefix \\ | Prefix of the images to show (filter by prefix) \\ | false \\ |
| shopId \\ | Shop ID from the shop that holds this product \\ | 0 (current shop) \\ |

h2. Placeholders

*These placeholders can be used in the tpl:*
|| Name \\ || Description \\ ||
| src \\ | The source of the image to be displayed (path to the image relative to the siteroot) \\ |
| rel \\ | Properties set in snippet call \\ |
| width \\ | width of the image \\ |
| height \\ | height of the image \\ |
| count \\ | Number of the #nd image shown, starting with 0 \\ |
?{scrollbar}