file_icon - Twig Function
Info
This feature is available in Contao 5.7 and later.
With this function you can generate a back end icon based on a file’s type. This is used for the back end in the template of the download(s) content element for example.
The function takes a FilesystemItem as its mandatory argument and also an alt attribute as well as an
HtmlAttribute instance as optional arguments.
Arguments
item: TheFilesystemItemto generate the file icon for.alt: The string for thealtattribute of the<img>.attributes: AnHtmlAttributesinstance for additional HTML attributes on the<img>.