core-bundle icon indicating copy to clipboard operation
core-bundle copied to clipboard

[Feature] Add the file type icons to the download(s) content elements preview in BE

Open Aybee opened this issue 8 years ago • 4 comments

Go to online demo CE 'File elements' preview.

bildschirmfoto am 2017-08-29 um 11 40 48

bildschirmfoto am 2017-08-29 um 11 23 53

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 */

Aybee avatar Aug 29 '17 09:08 Aybee

I don't known if this really adds value now that the parent view has been compacted:

leofeyer avatar Nov 21 '17 16:11 leofeyer

It's a matter of taste. I think I will not die if you do not accept it 😉

Aybee avatar Nov 22 '17 22:11 Aybee

I like the icons :)

Toflar avatar Nov 23 '17 08:11 Toflar

+1

Anke avatar Aug 15 '19 22:08 Anke