Skip to content

Commit

Permalink
Update Docs: migrate Beta Features - Custom Mount Element (#7059)
Browse files Browse the repository at this point in the history
* Update Docs: migrate Beta Features - Custom Mount Element

* Update Docs: add more details to Custom Mounting

---------

Co-authored-by: Martin Jagodic <jagodicmartin1@gmail.com>
  • Loading branch information
privatemaker and martinjagodic authored Jan 23, 2024
1 parent c21b30d commit 4411cc0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 0 additions & 5 deletions website/content/docs/beta-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down
17 changes: 17 additions & 0 deletions website/content/docs/custom-mounting.md
Original file line number Diff line number Diff line change
@@ -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:

<div id="nc-root"></div>

0 comments on commit 4411cc0

Please sign in to comment.