Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Background Image Field

Background Image FIeld module allows you to create a field on an entity type. It requires responsive images mapping in order to offer the best image quality for the device it is rendering on. The field will define the CSS selector to attach the background image too and then allow you basic CSS options repeat, size, and position so you can define a per image solution for your frontend needs.

Dependencies

  • Token
  • Core: Responsive Images

Similar Projects

Formatters are used in the process of how fields are rendered. A formatter is an addition to how a field works and is not a field itself. Formatters can solve global issues while using the base fields configuration. Formatters that have similar features as the Background Image Field:

The biggest differences you will notice is that the formatters will apply it setting globally to all content that is being rendered with that formatter. Using a field-specific solution allows you the control of each individual content of the field type per entity type i.e. node, paragraph_item, or custom entity. This field type makes your background image content more dynamic per page and allows more control over how your background image will render. Having this as a field also allows you a different way to apply it to content, query it in views, custom personalization per item created with it.

Installation

Install as you would any other drupal module. See more information here.

Configuration

  1. Create responsive image style /admin/config/media/responsive-image-style
    • The only responsive image style that will be picked up by the field formatter are the ones that have selected a single image style.
  2. Add the field on an entity type such as node, paragraph_item or, custom entity.

Troubleshooting

If you do not see the background image, please make sure to check that the CSS selector is part of the rendered HTML. This field will not create the selector you choose, it already has to exist in the HTML.

If there is no responsive image style available in the drop-down on the display management form the most common issue is you will need to create the desired responsive image style following the outline above. You can also find more details here on the responsive image style guide

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-2.2 Stable Dec 1, 2024
8.x-2.x-dev Dev Dec 1, 2024