Skip to content
Snippets Groups Projects
user avatar
John Franklin authored
Issue 3063961 by john franklin: Don't override the file extension handling of the base ImageItem or ImageWidget.
a55314f1
History

CONTENTS OF THIS FILE

  • Introduction
  • Similar Projects
  • Requirements
  • Installation
  • Configuration
  • Troubleshooting
  • Maintainers

INTRODUCTION

The Background Image Field module allows the user 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.

SIMILAR PROJECTS

Formatters that have similar features as the Background Image Field:

The biggest differences you will notice is that the formatters will apply the setting globally to all content that is being rendered with that formatter.

Using a field-specific solution allows the user to control each individual field type per entity type i.e. node, paragraph_item, or custom entity. This field type makes the background image content more dynamic per page and allows more control over how the background image will render.

Having this as a field also allows the user different ways to apply it to content, query it in views, and custom personalization per item created with it.

REQUIREMENTS

This module requires the following modules outside of Drupal core.

INSTALLATION

CONFIGURATION

1. Navigate to Administration > Extend and enable the module.
2. Navigate to Administration > Configuration > Media > and create a
   responsive image style.
   Note: The only responsive image style that will be picked up by the field
   formatter are the ones that have selected a single image style.
3. Navigate to Administration > Structure > Content types > [Content type to
   edit] > Manage fields and add the field on an entity type such as node,
   paragraph_item or, custom entity.
4. Define the CSS selector to attach the background image. Select a repeat
   option, background size, and background position.
5. Save settings.

TROUBLESHOOTING

If you do not see the background image, please make sure to check that the CSS selector is actually apart of the HTML. The field will not create the selector you choose, it already has to exist for it to work.

If you don't see any available responsive image styles in the managed display setting on the entity type you will most likely need to create one following the outline configurations above.

MAINTAINERS

Active Maintainers:

Module Development and Maintenance:

Initial development for the formatter in the Background Image Field: