Problem/Motivation
Editors can upload big images or no web-optimized.
Adding a option to select a Image Style will be more flexible for editors.
Steps to reproduce
Proposed resolution
If we want this to be optional, add a checbox and then a select with all Image Styles availables, this could be done per plugin instance, not global settting.
Update buildBackgroundMediaImage funciton to create image url using the Image style selected.
This could help: https://gist.github.com/slivorezka/925dff0369e8eddc7e4ffa4801ab0240
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3167538-14.patch | 5.12 KB | sardis |
| #12 | 3167538-12.patch | 5.4 KB | mauriciopieper |
Issue fork bootstrap_styles-3167538
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aaronchristian commentedThis is a much needed enhancement!
Love your thinking @edysmp
Comment #3
nitesh624Working on it will update in few days
Comment #4
nitesh624Comment #5
nitesh624Unassigning from me , so that others can also work
Comment #6
nitesh624Comment #7
edysmpComment #8
mahmoud-zayed commentedComment #11
matt_paz commentedComment #12
mauriciopieper commentedCreated this patch based on the merge request from @matt_paz.
I did some small changes/improvements because it was an old MR, but in essence, it does the same.
Comment #13
b_sharpe commentedThis need to be passing the interface
FileUrlGeneratorInterfaceotherwise you'll have issues with other file generators.Comment #14
sardis commented@b_sharpe is right indeed. Such an error can be reproduced should you enable CDN module.
Attached is an updated patch that uses
FileUrlGeneratorInterfaceinstead ofFileUrlGenerator.Comment #15
rajab natshahThanks, for reporting and patching!
While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well.
Comment #16
rajab natshahComment #17
rajab natshahComment #18
rajab natshahComment #19
rajab natshahNice idea and fix
Planed for #3299909: Fix Layout Builder section rendering original Background Image when no background options, no image styles, or lazy loading are applied
But seems that this is a good way to fix the issue.
Comment #20
super_romeo commentedThanks for the patches #12 and #14. They are on the right track.
But I think we need to set the responsive image style, not the image style.