From 4411cc0b12a4e3815df5eca767e0ac5b07611ed0 Mon Sep 17 00:00:00 2001 From: Private Maker Date: Tue, 23 Jan 2024 14:10:53 +0100 Subject: [PATCH] Update Docs: migrate Beta Features - Custom Mount Element (#7059) * Update Docs: migrate Beta Features - Custom Mount Element * Update Docs: add more details to Custom Mounting --------- Co-authored-by: Martin Jagodic --- website/content/docs/beta-features.md | 5 ----- website/content/docs/custom-mounting.md | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 website/content/docs/custom-mounting.md diff --git a/website/content/docs/beta-features.md b/website/content/docs/beta-features.md index 85f20eeef3b6..b54c1f6258ed 100644 --- a/website/content/docs/beta-features.md +++ b/website/content/docs/beta-features.md @@ -93,11 +93,6 @@ sections: - images/image06.png ``` -## Custom Mount Element - -Decap CMS always creates its own DOM element for mounting the application, which means it always takes over the entire page, and is generally inflexible if you're trying to do something creative, like injecting it into a shared context. - -You can now provide your own element for Decap CMS to mount in by setting the target element's ID as `nc-root`. If Decap CMS finds an element with this ID during initialization, it will mount within that element instead of creating its own. diff --git a/website/content/docs/custom-mounting.md b/website/content/docs/custom-mounting.md new file mode 100644 index 000000000000..fd8c5c5552ad --- /dev/null +++ b/website/content/docs/custom-mounting.md @@ -0,0 +1,17 @@ +--- +title: Custom Mount Element +weight: 90 +group: Customization +--- + +Decap CMS always creates its own DOM element for mounting the application, which means it always takes over the entire page, and is generally inflexible if you're trying to do something creative, like injecting it into a shared context. + +You can now provide your own element for Decap CMS to mount in by setting the target element's ID as `id="nc-root"`. If Decap CMS finds an element with this ID during initialization, it will mount within that element instead of creating its own. + +This is useful if you want to create a wrapper around the CMS, like a custom header, footer, or sidebar. + +**Example** + +Adding the following div to `admin/index.html` will cause the CMS to load within it: + +