Issue #1135πŸ’¬ AnsweredOpened May 25, 2018by JulyanoF0 reactions

Two html tags as one (link/button)

Quick answerby artf

You should create a custom component

Read full answer below ↓

Question

Is it possible to have two elements (div and lnik) and consider as a single? For example: there is the my following link block:

<div class="row"><a class="btn" href="http://test.com">Link Here</a></div>

And I would like that on click div or button, it shows the <a> as a selected element on editor views, but in wrapper, show the div as a selected.

Answers (3)

JulyanoFβ€’ June 1, 2018

@artf I tried extending original link component, but it seems not working It's not changing anything.. I already tried to disable autorender and render after all changes. I could change the content only setting a new, using BlockManager: bm.get('c85').set({ content: '<div class"row"><a class="btn">...

JulyanoFβ€’ June 11, 2018

@artf as you said, I tried to use Components, but I didn't get expected result. Could you help me? My link block prints this content: <div style="height:45px;margin:0 auto 10px auto;padding: 5px 5px 5px 5px;width: 100%;text-align:center"><a class="btn btn-purple">Button</a></div> I'm trying to get...

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.