This macro is bundled with all the XWiki products by default.
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

NameOptionalAllowed valuesDescription
mimetypenoa stringmime type, i.e., of an attachment
filenamenoa stringfilename, i.e., of an attachment.

Note : both parameters must be in lower case as the macro does no conversion

Example

#mimetypeimg("image/jpeg" "photo.jpeg")

For instance if $attachment is a file attachment:

#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:

jpg.png

Version 5.1 last modified by VincentMassol on 19/06/2008 at 22:09

Comments 0

No comments for this document

Attachments 1

Image
jpg.png 1.3
PostedBy: LuisArias on 09/12/2007 (1kb )

Creator: LuisArias on 2007/04/08 09:51
This wiki is licensed under a Creative Commons license
1.4.1.10194