IconForResource ViewHelper <core:iconForResource>

Displays icon for a FAL resource (file or folder means a TYPO3\CMS\Core\Resource\ResourceInterface).

Examples

Default:

<core:iconForResource resource="{file.resource}" />
Copied!

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>
Copied!

Source code

Go to the source code of this ViewHelper: IconForResourceViewHelper.php (GitHub).

Arguments

The following arguments are available for <core:iconForResource>:

Name Type Default
mixed
string 'small'
string
mixed array ()
string
resource
Type
mixed
Required

true

Resource

size
Type
string
Required

true

Default
'small'

The icon size

overlay
Type
string
Required

true

Overlay identifier

options
Type
mixed
Required

true

Default
array ()

An associative array with additional options

alternativeMarkupIdentifier
Type
string
Required

true

Alternative markup identifier