You are here: Foswiki>System Web>Category>UserDocumentationCategory>Macros>VarICON (2024-12-23, UnknownUser)Edit Attach
Generates a small graphic image from the set attached to DocumentGraphics. Images typically have a 16x16 pixel size. You can select a specific image by name, or you can give a full filename, in which case the type of the file will be used to select one of a collection of common file type icons. If you specify an icon which cannot be found, the one specified in the default
parameter will be used (and if that fails, the else
icon will be used)
Parameter | Description | Default |
---|---|---|
"filename or icon name" | requested icon | else |
default | default icon to use if requested icon is not found | |
alt | alt text to be added to the HTML img tag | |
quote | allows you to control the quote used in the generated HTML | " |
%ICON{"flag-gray"}%
displays as %ICON{"pdf"}%
displays as %ICON{"docx" default="doc"}%
displays as %ICON{"smile.pdf"}%
displays as %ICON{"/dont/you/dare/smile.pdf"}%
returns %ICON{"data.unknown" alt="Unknown file type"}%
displays as %ICON{"data.unknown"}%
displays as arrowbright
, bubble
, choice-yes
, hand
bmp
, doc
, gif
, hlp
, html
, mp3
, pdf
, ppt
, txt
, xls
, xml
, zip
If you find that ICON is producing broken HTML when it is used in another macro e.g. for formatting search results, then this may be because it is using the wrong kind of quotes for the context. In this case you can control the quotes it uses using the quote
parameter. For example
%ICON{"pdf" quote="'"}%
You can also use formatting tokens such as $quot
and $dollar
in quote
.
Edit | Attach | Print version | History: r1 | Backlinks | View wiki text | Edit wiki text | More topic actions
Topic revision: r1 - 2024-12-23, UnknownUser
Copyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback