Show image in a widget. Supports also refreshing the image in timely bases, making it handy for webcams, daily comics or kittens :)
📢 NOTE: See mozaik-2 branch for Mozaik 2 compatible extension
Table of contents
- Install extension:
npm i -S mozaik-ext-image
- Register widget:
mozaik.addBatch('image', require('mozaik-ext-image'));
- Add widget(s) in dashboard
config.js
(see Widget parameters)
Show the image in widget.
key | required | description |
---|---|---|
url |
yes | URL to an image. |
title |
no | Title to show in widget. Defaults to URL |
refreshInterval |
no | Image refreshing interval in seconds (refreshing is done automatically by adding/incrementing counter attribute). Defaults to no refresh. Example: 30 |
backgroundSize |
no | Image size (set as background image). Defaults to 'cover' |
backgroundColor |
no | Background color, handy with transparent images. Defaults to parent color |
backgroundPosition |
no | Background position, defaults to 'center center' |
{
type: 'image.image',
title: 'My webcam',
url: 'http://domain.com/webcam.jpg',
backgroundSize: 'cover',
backgroundPosition: 'center -7vh',
// Refresh every 30s
refreshInterval: 30,
columns: 1, rows: 1,
x: 0, y: 0
}
Distributed under the MIT license