Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Expand on mimetype aliases and image retrieval #1373

Merged
merged 1 commit into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions admin_manual/configuration_mimetypes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ Mimetypes Management
mimetype_aliases
mimetype_mapping

Icon retrieval
--------------

When an icon is retrieved for a mimetype, if the full mimetype cannot be found,
the search will fallback to looking for the part before the slash. Given a file
with the mimetype 'image/my-custom-image', if no icon exists for the full
mimetype, the icon for 'image' will be used instead. This allows specialised
mimetypes to fallback to generic icons when the relevant icons are unavailable.
46 changes: 36 additions & 10 deletions admin_manual/configuration_mimetypes/mimetype_aliases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,43 @@ possible to show more specific icons for certain mimetypes. Take as an example
audio files. It is nicer if they show a nice audio icon instead of the default
file icon.

By default ownCloud comes with ``mimetypealiases.dist.json``. This is a
simple json array.
Administrators should not update this file as it will get replaced on upgrades
of ownCloud. Instead the file ``mimetypealiases.json`` should be created and
modified, this file has precedence over the shipped file.
By default ownCloud is distributed with ``config/mimetypealiases.dist.json``.
Administrators should not modify this file, as it will be replaced when
ownCloud is updated.

Updating mimetype aliases
-------------------------
If there is a custom ``mimetypealiases.json`` and that is edited or ownCloud is
updated you should run::
Adding custom aliases
---------------------

Custom mimetype aliases can be added to ``config/mimetypealiases.json``, using
the same syntax as ``config/mimetypealiases.dist.json``. Some common mimetypes
that may be useful in creating aliases are:

image
Generic image

image/vector
Vector image

audio
Generic audio file

x-office/document
Word processed document

x-office/spreadsheet
Spreadsheet

x-office/presentation
Presentation

text
Generic text document

text/code
Source code

Once you have made changes to ``config/mimetypealiases.json``, run the
following to propogate the changes through the system::

$ ./occ maintenance:mimetypesjs

This commands makes sure that the changes are propagate through the system.