Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Offshoot from http://drupal.org/node/62741.
Attached patch adds the possibility for mime type based file icons if the theme is providing some. These have to be stored in a subfolder /mime
below your current theme directory, i.e. /themes/yourtheme/mime/jpeg.png
or /themes/yourtheme/mime/pdf.png
.
- If no mime type icon is found, an arrow is displayed.
$file->url
is defined in front of theming now.
Comment | File | Size | Author |
---|---|---|---|
#5 | inline-HEAD.mime_.patch | 1.22 KB | sun |
#4 | INSTALL.mime-theming.patch | 1.42 KB | sun |
inline.mime-theming.patch | 3.49 KB | sun | |
Comments
Comment #1
sun@ymcp: Looked after your remark (http://drupal.org/node/62741#comment-117263) - if you provide a description for your uploaded file, this description will be displayed below the file name, i.e.
If you do not supply a description, the second line will not be displayed.
Comment #2
ymcp CreditAttribution: ymcp commentedI didn't give a description when I uploaded the file. The inline module just seems to have used the file name.
Anyway, on a more interesting note, I have located some GPL file type icons. It might be nice to use them with this module. Since the "inline" module is also GPL, there shouldn't be any problem using them. It would be nice to have a note in the README about where to get these icons, or (even better) a default "/mime/" folder with some common icons included as part of this package.
Anyway, the icons are from the KDE project. You can see them all in the online svn repository, or download the entire (20+ Mb) kdebase tar-ball, and extract all the files called "cr*.png".
There are several sizes. I think "cr32-app-acroread.png" makes a nice pdf logo, "cr32-app-abiword.png" would work for ".doc" files, while "cr32-app-edu_mathematics.png" might do for spreadsheets.
Comment #3
sunI can't reproduce the bug you mentioned, even not with the attached patch of this issue.
will display:
And
will display:
If you do not alter the default description of your attachment in the upload section, then the following will be output:
If you define a custom description then it will be
Using Drupal 4.7.1-stable with upload.module.
Comment #4
sunAttached is an update for INSTALL.txt, describing the usage of mime type icons with inline.module.
@ymcp: I would like to postpone the discussion of including default GPL'd mime type icons with inline.module. There have been a lot discussions on Drupal.org regarding this topic and I do not want to delay this commit just because of this discussion. There also more questions to answer, f.e. one would like to have 16x16 icons, someone else maybe bigger icons with 32x32. Please open a separate issue for this topic if you feel that this is needed.
Comment #5
sunThanks for reporting, reviewing, and testing! Committed to 2.x.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.