Issue #2622πŸ’¬ AnsweredOpened March 4, 2020by light-effect0 reactions

Asset manager addType function not working after reload page

Quick answerby artf

Follow the issue template if you're submitting a bug, you have to create, at least, a reproducible demo

Read full answer below ↓

Question

am.addType('svg-icon', { view: { // getPreview() and getInfo() are just few helpers, you can // override the entire template with template() // Check the base template() here: // https://github.com/artf/grapesjs/blob/dev/src/asset_manager/view/AssetView.js getPreview() { return <div style="text-align: center">${this.model.get('svgContent')}</div>; }, getInfo() { // You can use model's properties if you passed them: // am.add({ // type: 'svg-icon', // svgContent: '<svg ...', // name: 'Some name' // }) // ... then // this.model.get('name'); return '<div>SVG description</div>'; }, }, isType(valu...

Answers (1)

artfβ€’ March 7, 2020

Follow the issue template if you're submitting a bug, you have to create, at least, a reproducible demo

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.