Back to top anchor
Documentation

Sector Media file types and configuration (Sector D8)

Changes to the media management from May 2020!

From May 2020, the new media library replaces the Sector media browsers for images, files and videos, and Sector sites first launched after May 2020 will take advantage of the new, easy to use, and customisable interface. Not sure if that's you? Have a quick look at the WYSIWYG toolbar - three media buttons old, one button new! Find out what changed in Working with the new media library. 

 

User role
Drupal Sitebuilder
Task
Sitebuilding Backend
Topic
Media management
Product
Sector Starter kit

Sector Media aims to minimise the number of Media contribution modules and to rely on Drupal core Media features as far as this is possible based on the progress of the Drupal Media in core initiative. 

More around the Sector media strategy can be found on the Sector D8 media roadmap.

Features and functionality

Public vs. private file systems

The file field upload destination in Sector is set to the public file system. This is good enough for most (but not all) sites - learn more in our article Public vs. private file systems

The Sector 8.x-2.0-alpha2 release includes the first part of our Sector media integration. It includes:

  • Media management via the media manager 
  • Media file types for files and images
  • The ability for the content editor to upload and embed media images and files from the WYSIWYG editor. 
  • Media view modes for both images and files managed via Display Suite. 

Included media contribution modules

Sector 8.x-2.0-alpha2 includes the following - not yet core - media contrib. modules:

Related entities and configuration (Sector D8)

Sector Media file types

<your-domain>/admin/structure/media 

Sector 8.x-2.0-alpha2 includes preconfigured media types for images and files. All displays are hooked into Display Suite view modes to allow consistency and easy display management.

Please note: We have disabled the Drupal core caption field and replaced it with a Sector custom text field. This allows us control via Display Suite and to add basic formats to the caption or credit notice, e.g. the ability to link to a source or copyright holder. Hiding the Drupal caption removes the functionality to add node specific captions to embeds - our credit or caption field falls back to the metadata of the image. We are looking into options to improve this in the future. 

Preconfigured media meta data fields 

File media type:

  • Title (Sector custom)
  • Credit and caption (Sector custom - Limited to Restricted Basic HTML).
  • Filesize (Sector custom)
  • Mimetype (Sector custom)
  • Tags (Sector custom)

Image media type:

  • Title (Sector custom)
  • Credit and caption (Sector custom - Limited to Restricted Basic HTML).
  • Tags (Sector custom)

Preconfigured URL pattern 

<your-domain>/admin/config/search/path/patterns

URL pattern are configured using tokens 

  • Sector file    file/[media:field_title]
  • Sector image    image/[media:field_title]

Sector Media view modes  

<your-domain>/admin/structure/display-modes/view 

The media view modes allow control over how images and files are displayed in both the AdminUI and the frontend.

Inherited from Drupal core:

  • Full content  
  • Token

Sector Custom configuration  

  • Full width
  • Half width
  • Preview
  • Short teaser
  • Teaser  

Media Browser(s)  

<your-domain>/admin/structure/views/view/media_entity_browser

The Sector media browser configuration includes two custom displays in the default media browser view - one for images and one for files. 

<your-domain>/admin/config/content/entity_browser

Based on the view displays, we have configured four entity browsers - two for images and files, each to be used in either the CKeditor (via iframe) or in the media field uploads (via modal). 

  • Media Entity image 
  • Media Entity file
  • Media Entity image alternate (CKeditor)
  • Media Entity file alternate (CKeditor)

Entity Browser Permissions

Entity Browser comes with permissions per configured browser, so the permissions need to be reviewed to allow editorial user roles access. 

<your-domain>/admin/people/permissions

Sector by default allows both content editor and content administrator roles to access the media entity browsers. 

Media embed buttons and icons

<your-domain>/admin/config/content/embed

Media embed buttons are used in the WYSIWYG editor tool bar. 

  • Media Entity image (Sector custom)
  • Media Entity file (Sector custom)

<your-domain>/admin/config/content/formats

And added to the WYSIWYG editor tool bar for both Basic and Full HTML text formats. 

Sample content

From 8.x-2.0-alpha2 Sector includes basic theming for both images and files. 

Media sample content 

  • Word document <your-domain>/file/sample-file-word
  • PDF document <your-domain>/file/sample-file-pdf
  • Landscape image <your-domain>/image/sample-image-landscape
Media added to pages

To easily test and showcase the media configuration we have added media fields - teaser and banner image - to the content type Page and Resource, as well as extended the Sector WYSIWYG Content Elements page with media embeds in the content area. 

  • Homepage with page banner
    <your-domain>
  • Section entry page with page banner
    <your-domain>/section
  • Sample image and document content embeds 
    <your-domain>/section/sector-wysiwyg-content-elements
  • Sample page with file attachment 
    <your-domain>/section/sector-standard-page-sample
  • Sample news with file attachment 
    <your-domain>/news/news-content-sample
  • Sample resource with file attachment 
    <your-domain>/resources/resource-content-sample-long-descriptive-title
Video

Last updated

Sector 9 is out!

With Drupal 9 released, we have published our Sector 9 roadmap as well as completed the first release for Sector 9.

Need Help?

Sector is brought to you by Sparks Interactive - supporting Sector from Wellington and Auckland

Open Source award winner!

Sparks Interactive are delighted to accept the Open Source Use in Business award for Sector and the Sector.nz open source platform.

Subscribe for Sector updates