Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs: migrate Beta Features - Custom Mount Element #7059

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>