diff --git a/modules/ROOT/pages/8.4.0-release-notes.adoc b/modules/ROOT/pages/8.4.0-release-notes.adoc index 9d8d4ba772..ae8e183b0f 100644 --- a/modules/ROOT/pages/8.4.0-release-notes.adoc +++ b/modules/ROOT/pages/8.4.0-release-notes.adoc @@ -57,6 +57,21 @@ For information on the **** plugin, see xref: The {productname} {release-version} release includes an accompanying release of the **** premium plugin. diff --git a/modules/ROOT/pages/fullpagehtml.adoc b/modules/ROOT/pages/fullpagehtml.adoc index e09e314def..f636407a2f 100644 --- a/modules/ROOT/pages/fullpagehtml.adoc +++ b/modules/ROOT/pages/fullpagehtml.adoc @@ -109,6 +109,8 @@ include::partial$configuration/fullpagehtml-default-body-style.adoc[leveloffset= include::partial$configuration/fullpagehtml-hide-in-source-view.adoc[leveloffset=+1] +include::partial$configuration/fullpagehtml-getcontent-setcontent.adoc[leveloffset=+1] + include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[] include::partial$toolbar-button-ids/{plugincode}-toolbar-buttons.adoc[leveloffset=+1] diff --git a/modules/ROOT/partials/configuration/fullpagehtml-getcontent-setcontent.adoc b/modules/ROOT/partials/configuration/fullpagehtml-getcontent-setcontent.adoc new file mode 100644 index 0000000000..7551bec2f6 --- /dev/null +++ b/modules/ROOT/partials/configuration/fullpagehtml-getcontent-setcontent.adoc @@ -0,0 +1,22 @@ +[[fullpagehtml-getcontent-setcontent]] +== `+fullpagehtml+` option for `+getContent()+` and `+setContent()+` + +When the {pluginname} plugin is active, `editor.getContent()` and `editor.setContent()` return and accept the full HTML document by default. The `fullpagehtml` option allows getting and setting only the body content when needed. + +Pass `fullpagehtml: false` in the options object to bypass full-page processing and work with body content only: + +* `editor.getContent({ fullpagehtml: false })` — Returns only the `` content. +* `editor.setContent(content, { fullpagehtml: false })` — Sets only the body content without modifying the document head. + +This option is useful when saving or loading body content separately (for example, when storing content in a database or when integrating with systems that expect body-only HTML). Unlike `fullpagehtml_hide_in_source_view`, which affects only the source code view display, the `fullpagehtml` option affects API behavior and requires no configuration. + +=== Example: getting and setting body content + +[source,js] +---- +// Get only the body content for saving +const bodyContent = editor.getContent({ fullpagehtml: false }); + +// Set only the body content (preserves document head) +editor.setContent(newBodyContent, { format: 'html', fullpagehtml: false }); +----