The MediaLibrary module allows you to save all your image, file, movie or audio files in one place. We call these files MediaItem entities. A MediaGroup is a collection of MediaItem entities. You can use MediaGroup entities in your custom module entities.

class BlogArticle
     * @var MediaGroup
    private $images;

     * @var MediaGroup
    private $trailers;

Read more about the module structure.

Frontend widgets

In the frontend you can choose how you wish to show the MediaGroup entities.

Default media widgets

  • Lightbox (php, html) - clicking a thumbnail will open a lightbox
  • Listing (php, html) - a list <ul> containing the links to the source files
  • OneImage (php, html) - the first image will be shown
  • OneRandomImage (php, html) - randomly pick one image from your MediaGroup
  • Slider (php, html) - thumbnails will be created to show a slider

Custom media widgets

This is the best part. Everything is so flexible. Nothing is holding you back from creating your own amazing media widget. The widget can be placed in your own custom module.

How to create custom frontend widgets?