Image.getPictureHTML (Method)

Returns HTML string containing a picture tag for specified image at the specified size. If the WebP generation is enabled and the WebP image if missing it will be generated on the fly and included in the picture tag..

Returns:

String

Arguments:

Name Type Required Description
imageStruct ImageInfo Required An ImageInfo structure containing information about the image. This structure is passed to render handlers that contain image fields, or you can call Image.getRenderInfo to obtain the structure given an imageID.
sizeName PlainText Optional. Defaults to 'largest'. The name of the image size, or 'largest' or 'smallest'.
attributes Struct Optional. Defaults to '#StructNew()#'. An associative array of attribute name pair values that will be added to the img tag - for example id, name, class, style, etc.

Context:

License Requirements None
Permission Requirements ContributorOrServerCode
Deny Context None
Require Context None
Author Lock (not required)
Transaction Logging Transaction logging is disabled for this method
Customization This method may be customized at the site level

Error Codes:

Code Error Message
24514 Attribute name '$1' cannot containing double quotes.
24515 Invalid size name provided.

Notes:

None