Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
IconForResource ViewHelper <core:iconForResource>
Note
This ViewHelper is not available by default.
Import its namespace
{namespace core=TYPO3\
in the Fluid file or
xmlns:
in the opening HTML tag.
Displays icon for a FAL resource (file or folder means a \TYPO3\
).
Examples
Default:
<core:iconForResource resource="{file.resource}" />
Output:
<span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-text-html" data-identifier="mimetypes-text-html">
<span class="icon-markup">
<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/mimetypes/mimetypes-text-html.svg" width="16" height="16">
</span>
</span>
Source code
Go to the source code of this ViewHelper: IconForResourceViewHelper.php (GitHub).
Arguments
The following arguments are available for <core:
:
resource
-
- Type
- mixed
- Required
true
Resource
size
-
- Type
- string
- Default
'small'
The icon size
overlay
-
- Type
- string
Overlay identifier
options
-
- Type
- mixed
- Default
array
()
An associative array with additional options
alternativeMarkupIdentifier
-
- Type
- string
Alternative markup identifier