Issue #1237Opened June 26, 2018by ionic6660 reactions

Before you drag and drop the image,there was nothing in assetManager

Question

qq20180626-104503 and I don't know how to set the backgroundImage

Answers (3)

ronaldaugJune 28, 20180 reactions

@ionic666 you can read Asset API documentation here There is no image in your asset manager. It seems you haven't added it yet. You can add like this..

grapesjs.init({
....
.....
 assetManager: {
          assets: [
                  {
                  type: 'image',
                  src: 'http://via.placeholder.com/250x350/0174DF/ffffff/',
                  date: '2018-06-28',
                  height: 350,
                  width: 250
                    },
                  {
                  type: 'image',
                  src: 'http://via.placeholder.com/250x350/5FB404/ffffff/',
                  date: '2018-06-28',
                  height: 350,
                  width: 250
                    }
            ]
          }
....
....
})
ionic666June 28, 20180 reactions

@ronaldaug tim 20180628171659 i have done it.but I mean that if i haven't drag the image component,I cannot set background images for other components. The official demo was also not available

ronaldaugJune 28, 20180 reactions

Maybe, you didn't add the component type as image. Make sure you add it. And you can just double click on the image to trigger the assets images box.

Could you share your codes via codepen or jsfiddle?

Do you mean this official demo ? I can see the images under Flex is the new black section do not work. It's because the images were added via CSS codes.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.