Issue #482💬 AnsweredOpened November 3, 2017by krunal0390 reactions

Default asset manager in custom component

Quick answerby artf

@krunal039 Why do you need a custom component? Your template seems to be pretty simple, what about just a simple block?

Read full answer below ↓

Question

I am in process to create custom component for below template and we want to have user enter text,link,hover text and select image and want to use default asset manager to select image but not sure how to get selected image in custom component? below is code I have used view: defaultType.view.extend({ init() { this.listenTo(this.model, 'active', this.doStuff); // listen for active event }, doStuff() { editor.runCommand('open-assets', { target: editor.getSelected() }); } });

Answers (3)

artfNovember 6, 2017

@krunal039 Why do you need a custom component? Your template seems to be pretty simple, what about just a simple block?

krunal039November 6, 2017

@artf thanks for reply, we need user input for hover text, background image and text and hyperlink at bottom and thought to use custom component, but if we can prompt user to enter above then happy to create just block, can you pease guide me in correct direction, I am struggling since 4-5 days?

artfNovember 6, 2017

Try to create a block with your template, drag it inside the canvas and you will be able to change all that stuff

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.