(image: …)
Embeds an image
Attributes
In addition to the main image
, option, the tag supports the following attributes:
alt
caption
class
height
imgclass
link
linkclass
rel
srcset
target
title
width
Attribute | Description | Default |
---|---|---|
alt | The alt attribute that is added to img element | null |
caption | The caption | null |
class | The class which is added to figure element | null |
height | The height which is added to img element | null |
imgclass | The class which is added to img element | null |
linkclass | The class which is added to link element | null |
rel | The rel attribute that is added to link element | null |
srcset | The srcset attribute that is added to link element | null |
target | The target attribute that is added to link element | null |
title | The title attribute that is added to img element | null |
width | The width which is added to img element | null |
Attribute defaults from config
You can customize the defaults of this tag's attributes via the kirbytext.image
config option.
Examples
Image of the current page
Image of another internal page
External image
Image with alternative text
Image with a caption
Image with a title
attribute
Image with a link
Image with a link to itself
Image with a link to an internal page
Image with a link to an internal file
Image with a link and a specified target
Image with a link and a rel
attribute
Image with a custom CSS class applied to the figure element
Image with a custom CSS class applied to the img element
Image with a custom CSS class applied to the link element
Image with defined width
and height
attributes
Since 4.4.0
Width and height can also be set to auto, which will automatically be replaced by the actual image dimensions.
This behaviour can also be set as global default for all image kirbytags in your config file.
Since 4.0.0
Image with srcset
with absolut sizes
Image with srcset
from a config srcset name
Use srcset defaults you defined in the thumbs
config option: