An image type is a container of an image asset with an associated caption.
Properties
Name | Type | Format | Description |
---|---|---|---|
asset | object | Asset | The asset that is linked to from the entry. |
caption | string | The image caption, defined in the entry. |
Example
Get an entry resolving all fields to a link depth of 1 and output properties of the resolved 'thumbnailImage' field
const entry = await client.entries.get({
id: "<entry-id>",
linkDepth: 1,
});
console.log(entry.thumbnailImage.asset.sys.uri);
console.log(entry.thumbnailImage.altText);
// A linkDepth of 1 is required to resolve the extended asset.sys fields
console.log(entry.thumbnailImage.asset.sys.properties.width);
console.log(entry.thumbnailImage.asset.sys.properties.height);