MimeTypeImage Macro
This is a Velocity macro, bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.
MimeTypeImage Macro
Displays an icon for a variety of common mime types and file name extensions including:- images
- office documents
- various other types of files
Usage
#mimetypeimg($mimetype $filename)
Parameters definition
| Name | Optional | Allowed values | Description |
|---|---|---|---|
| mimetype | no | a string | mime type, i.e., of an attachment |
| filename | no | a string | filename, i.e., of an attachment. |
Example
#mimetypeimg("image/jpeg" "photo.jpeg")
#mimetypeimg($attachment.getMimeType().toLowerCase() $attachment.getFilename().toLowerCase())
Result
Available icons are located in the mimetypes directory of the albatross or finch skin. For instance for a jpeg file the result will be: