[QUESTION] How can I set the background image of a component programtically.
Question
Hello,
I want to create an option to change background of a component by double clicking it. I could open the modal when double clicking it. But how can I se the background-image property using it. I checked the codebase couldn't find a clue. Have any one done something similar. Please provide some suggestions or leads.
Answers (1)
@ajumell when, for example, you select the background to apply you can change the component background in this way
component.addStyle({ 'background-image': `url('${url}')` })
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3415
QUESTION: Custom Asset Manager. How to set bg image
Hi there! I'm building a custom modal for the Asset Manager and basically, it seems that I need to override command. How I can understand i...
Issue #378
How to change bg colors?
Can't find any option to change the color of bg? I want to place my own image (how?) and change the bg of the div-layer. Can't find this op...
Issue #2770
[QUESTION] Set selected element
Hello, is there a way to select an element after added to the body? When i add a link, i want to open the Component Settings immediately. H...
Issue #2696
[QUESTION]: How can I create block with background image with behavior like built-in "image"?
Hello, I'm trying to create block with background image (similar to Grapedrop Image Box). I added new component like this: And also I added...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.