core-bundle
core-bundle copied to clipboard
[Feature] Add the file type icons to the download(s) content elements preview in BE
Go to online demo CE 'File elements' preview.


It would be nice, if the BE preview of CEs download and downloads would show the file type icons. The classes are already there.
<div class="ce_downloads block">
<h2>Download List Example</h2>
<ul>
<li class="download-element ext-jpg"> <a href="..." title="">DSC_5276.jpg <span class="size">(41,0 KiB)</span></a></li>
<li class="download-element ext-jpg"> <a href="..." title="">DSC_5316.jpg <span class="size">(29,8 KiB)</span></a></li>
<li class="download-element ext-jpg"> <a href="..." title="">DSC_5403.jpg <span class="size">(35,6 KiB)</span></a></li>
</ul>
</div>
You can test it with devtools and this CSS. It's the CSS from icons.css https://github.com/contao-components/contao/blob/master/css/icons.css with modified path to the svg.
.download-element {
padding:3px 6px 3px 22px;
background:url("assets/contao/images/iconPLAIN.svg") left center no-repeat;
}
ul.enclosure {
padding-left:0;
}
li.download-element {
list-style-type:none;
}
/* Application files */
.ext-jpg {
background-image:url("assets/contao/images/iconJPG.svg");
}
/* snip */
I don't known if this really adds value now that the parent view has been compacted:
It's a matter of taste. I think I will not die if you do not accept it 😉
I like the icons :)
+1