Issue #518Opened November 14, 2017by HarshOB0 reactions

change only component body not whole page body.

Question

Hello @artf

As we discussed in issue #374. setComponents will set the body and replace all the contents that are present on the page with a new select page from the list. What if I want to set the body to only that component without changing the whole content of the page?

Answers (3)

artfNovember 15, 20170 reactions

You can replace the content of the model

// model could be, for instance, editor.getSelected()
model.components('<div>Text 1</div><div>Text 2</div>')
HarshOBNovember 17, 20170 reactions

How can I replace the content of a component with specific value like "Hello"?

artfNovember 17, 20170 reactions

Tried with this model.components('Hello')?!?

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.