How to use with views?

Created on 27 February 2020, over 4 years ago
Updated 6 March 2024, 7 months ago

Hi there. I'm trying to use the module to display node image as background of some div.

I need to do something more that select the formatter and use right css selector (class of div)? The module is not working in my site, no browser console errors with disabled Bigpipe -because I see some issue related to it-.

The only way that I see the image displayed is selecting inline option but it breaks my design because I only need to use it as background in some predefined div.

Thanks for your time.

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇷Argentina renguer0

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand luke.stewart

    I've also hit some issues with this module and views.

    It seems like perhaps somewhere the css that's being added is being stripped out when the view is rendered.

    getBackgroundImageCss is being called and returning the appropriate css to be added.

    Further debugging suggests that the issue might be when Big Pipe is enabled the html head is already set and not modified?
    If I change elements in viewElements to use the same inline method as this module -> https://www.drupal.org/project/background_image_formatter we end up with the style tag being rendered inline and working.

  • 🇳🇿New Zealand luke.stewart

    I've added a super quick proof of concept in the issue fork - just for the responsive image sub module. In case this highlights what the issue is. there is probably a better way to resolve this!

Production build 0.71.5 2024