Custom content type
Question
@artf Instead of using plugins js files, can we create our own content using html as I have done below. Is it a correct way to do it?
{
appendTo: '#blocks',
blocks: [
{
id: 'text',
label: 'List',
attributes: {class: 'fa fa-list-alt'},
content: '<div data-gjs-type="text" data-highlightable="1"><ul><li>List 1</li><li>List 2</li><li>List 3</li></ul></div>',
activate: true,
category: 'Standard UI Elements'
},
Sorry for the formatting unable to format.. Thanks in advance.
Answers (3)
Is it a correct way to do it?
yes...
Thank you for your reply @artf . I just have one more query I want to have an vertical carousel. So from the above code snippet where do I add say Jquery or script for delay or scroll effect
Create a new component type and follow this guide: https://grapesjs.com/docs/modules/Components-js.html
Related Questions and Answers
Continue research with similar issue discussions.
Issue #792
Script property using function don't work with blocks
In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said...
Issue #1624
replace html issue
I defined new forum block like this. I want to replace resource class with ajax response html. Currently I did it like this. The problem is...
Issue #854
Table block
I don't see any basic blocks that you can create a table. Even if I do the block, it is impossible to edit the text. Block example with thi...
Issue #2670
[QUESTIONS] Doesn't appear HTML class name of a custom block on editor
I added my block like this below Then drag this block and drop to canvas, and show HTML code with export-template command. 👆OK, this is wh...
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.