Image - Liquid Object Reference
On this page
Description
The Image object contains information about an image uploaded to the media library. To output an image, pass this object to the image_tag filter, which builds a complete responsive <img> element, or to image_url for a URL at a custom size.
:::note
This object supports custom data via the data attribute.
:::
Backed by
This drop renders the s_c__Media__c Salesforce object. A theme writes it as image.
| Liquid attribute | Salesforce field |
|---|---|
alt_text |
s_c__Alt_Text__c |
description |
s_c__Description__c |
file_type |
s_c__File_Type__c |
url |
s_c__Url__c |
Every other attribute on this drop is derived by StoreConnect rather than read straight from one field. The Attributes section lists them all.
Fields you add yourself are not listed above. Expose one with a Custom Data Mapping record, then read it from image.data. See custom data fields in Liquid.
Attributes
| Attribute | Type | Description |
|---|---|---|
alt_text |
String | Returns the value of the Alt Text attribute |
aspect_ratio |
Number | Returns the aspect ratio (width divided by height) of the original image, rounded to four decimal places. Empty when the width or height is not stored |
description |
String | Returns the value of the Description attribute |
file_type |
String | Returns the value of the File Type attribute |
height |
Number | Returns the pixel height of the original image. Empty when it is not stored |
huge_url |
String | Returns a url for this Image for the huge size |
icon_url |
String | Returns a url for this Image for the icon size |
id |
String | Returns the unique id for this Image |
large_url |
String | Returns a url for this Image for the large size |
massive_url |
String | Returns a url for this Image for the massive size |
medium_url |
String | Returns a url for this Image for the medium size |
pico_url |
String | Returns a url for this Image for the pico size |
small_url |
String | Returns a url for this Image for the small size |
srcset |
String | Returns a ready-to-use srcset value of candidate widths for this Image, from 320 to 2048 pixels and, when the width is stored, no wider than the original. Empty for GIF and SVG images, images not hosted on Cloudinary, and images too small to offer more than one width |
thumb_url |
String | Returns a url for this Image for the thumb size |
tiny_url |
String | Returns a url for this Image for the tiny size |
url |
String | Returns the default url for this Image |
width |
Number | Returns the pixel width of the original image. Empty when it is not stored |
Use srcset with your own <img> markup when you need full control over the element. Pair it with a sizes value so the browser can pick the right candidate:
```liquid
```
If srcset is empty, the browser falls back to src.
Available on
- Account - Liquid Object Reference —
logo - Article - Liquid Object Reference —
hero_image,social_image - ArticleCategory - Liquid Object Reference —
social_image - Brand - Liquid Object Reference —
logo - ContentBlock - Liquid Object Reference —
image - Location - Liquid Object Reference —
logo - LocationGroup - Liquid Object Reference —
social_image - Medium - Liquid Object Reference —
image - MenuItem - Liquid Object Reference —
image - Page - Liquid Object Reference —
social_image - Product - Liquid Object Reference —
image,images,social_image,variant_images - ProductCategory - Liquid Object Reference —
image,social_image - Store - Liquid Object Reference —
favicon,logo,social_image
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.