Skip to main content

Image

URL

image.url Get URL for resized image.

Parameters

  • width: Image width. Set width and leave height blank to keep the orinal aspect ratio.
  • height: Image height. Set height and leave width blank to keep the orinal aspect ratio.
  • crop: true or false. Crop image if given dimensions deviate from original aspect ratio. Default: false.

Examples

{{ image.url }}               {# returns the unresized image URL #}
{{ image.url({width: 100}) }} {# returns resized image URL #}

Note: It is not guaranteed to get back the resized image. If it is not ready yet, the source URL will be returned.

HTML

image.html Get HTML image tag for resized image.

Parameters

  • width: Image width. Set width and leave height blank to keep the orinal aspect ratio.
  • height: Image height. Set height and leave width blank to keep the orinal aspect ratio.
  • crop: true or false. Crop image if given dimensions deviate from original aspect ratio. Default: false.
  • id: Set image tag id attribute.
  • class: Set image tag class attribute.
  • style: Set image tag style attribute.
  • alt: Set image tag alt attribute.
  • title: Set image tag title attribute.

Examples

{{ image.html }}                       {# returns the unresized image tag #}
{{ image.html({width: 100}) }} {# returns resized image tag #}
{{ image.html({title: "The Spark"}) }} {# returns image tag with custom title #}

Note: It is not guaranteed to get back the resized image. If it is not ready yet, the source URL will be returned.