Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Image Library Widget

28 sites Security covered
View on drupal.org

This module provides an image upload widget that allows users to either upload a new image or select an existing one from a predefined media library. The library itself can be configured to display images of a specific media type, and the widget's browse functionality is powered by a customizable Views display.

Provides an image widget that allows users to upload or choose an existing image from a library with a predefined set of images. Each widget can be configured to show images within a media type.

How it works?

The widget extends the core's image widget but adds also an "image browser". The "image browser" is actually a view that exposes image entries from the media type that was configured with that widget. The user can use the standard upload feature, or they can select a pre-uploaded image by clicking in the "image browser".

Dependencies

  • PHP >=7.1.0
  • Media (core)
  • Views (core)

Limitations

  • Currently, the module supports only image fields with a single value (cardinality 1). Support multi-value image fields to be implemented in #3103574.
  • It's not possible to configure the "image browser" (the view) with a pager but without Ajax being enabled as navigating to a different widget page should be done without reloading the page where the widget is rendered.

Configuration

  • Create one or more new media types by visiting `/admin/structure/media/add`. Set the "Media type" to "Image" and under "Media source configuration" set the "Field with source information" to "media.image_library_widget_image". Only media types configured in this way can be used as libraries in the widget.
  • Give the appropriate permissions to site admins so they can create media entries within those media types.
  • Create some media entries.
  • Configure the image field to use "Image Library Widget" as widget.
  • In the widget settings form chose the media type to be used as image library.

Customization

Because the "image browser" is a view, you can do whatever Views customization you want. You can decide what display format to use (e.g. Grid, HTML List, Unformatted list, etc), or the size of image thumbnails. If there are to many images pre-ulploaded in that media type, you can configure a pager but in this case you'll need to enable Ajax (see "Limitations").

Activity

Total releases
2
First release
Jun 2025
Latest release
10 months ago
Releases (12 mo)
1
Maintenance
Slowing

Releases

Version Type Release date
2.0.0-alpha4 Pre-release Sep 8, 2025
2.0.0-alpha3 Pre-release Jun 13, 2025