Skip to main content

Media library

Introduction

The media library is used to hold the files containing images, pdfs, pdfs etc. and information related to them. They can thus be easily used in different web pages and any resizing and styling automatically carried out. Information such as image titles thus need to be defined in just once place and are available everywhere that it is used.

You can insert images (most common formats) and other media files (including pdf and spreadsheets) into pages (nodes) In most cases this is done via the image fields but thay can be included within the Body within a block of text that is being edited with CkEditor using the "Insert from Media Library" button.

For the item to display in the relevant page it has to be available on the LHG server in the Media Library. For images the default settings will make the image visible, although you may want to change some features eg size and position. For files there are options either to provide a link to the file or, in some cases, to be viewed within the page. Both spreadsheets and pdf documents can be viewed in a page with the correct settings.

Media entities

Drupal provides a variety of media types. We use [three]:

  • Image This will deal with png gif jpg jpeg.
  • Document This includes file types: txt rtf doc docx ppt pptx xls xlsx pdf odf odg odp ods odt fodt fods fodp fodg key numbers pages.
  • Remote video connections to YouTube, Vimeo [for admin use only].

Information on media items

We have provided  the ability to add additional fields for media items.

  • Descriptive information to help us manage our large set of media and these can be used to help searching for existing items:
  • Display information with the item:

The set of fields present depends on the media type

Images

  • Descriptive information to help us manage our large set of media and these can be used to help searching for existing items:
    • Section - to distinguish between historical information and images of items within exhibitions
    • District
    • Asset - to indicate the place/building/event
    • Alt text - A requirement for alternate text to describe the entity which is used by screen readers etc. used by visually impared users. The same text as the Title field is usually appropriate.
  • Display information with the item:
    • Title - for adding text under the image.
    • Date - when it was taken
    • Copyright -  so we can document this under images.
    • Notes - for adding more descriptive notes about the image perhaps the names of those people in it

When you enter the dialogue to select items from the media library some of these fields can be used to filter the list displayed to help choose appropriate items.

Upload new item

There is also a box that gives you the option to add (upload) a new file. Click 'Choose file' to start the upload process and this pops up a new window showing files on your computer. This  lets you choose the file to upload. The file name does need to have the appropriate suffix for that media type. If you select an inappropriate one a warning message is displayed telling you which type will be accepted. An image will then appear in the left hand region. That doesn't happen if it is an invalid file for that type. You will also get a rather cryptic 'This value should be of the correct primitive type.' when you try to upload it.

In most case you will have chosen a valid file, so you then need to fill in the fields in the right of the window that are used to describe the media item that will be created and which are used when searching for existing media items. There are also fields such as Title and Date which are displayed along with the media item in the web page. Then press 'Save and select' to upload it into the media library and continue the dialogue.