decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.67k stars 3.03k forks source link

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

Closed privatemaker closed 5 months ago

privatemaker commented 5 months ago

Given how minimal this is, it feels wrong it is on own page, but it seems semantically to make most sense.

I am not sure in what creative cases this is useful or what code to do it looks like- maybe because I am not a React developer? 🤔

@martinjagodic perhaps adding some example snippets and slightly more text or links to examples?

Relating to #7040

netlify[bot] commented 5 months ago

Deploy Preview for decap-www ready!

Name Link
Latest commit 948ded8ffb1b6facffc70ec8a390e6bc3731d222
Latest deploy log https://app.netlify.com/sites/decap-www/deploys/65afbab5f2aafc00086b8f3b
Deploy Preview https://deploy-preview-7059--decap-www.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

martinjagodic commented 5 months ago

I agree, this should be better documented. Let me take some time for this and get back with some snippets.

martinjagodic commented 5 months ago

It is pretty easy: Just add id="nc-root" to any element, and the CMS will load into it. It is useful if you want to create a wrapper around the CMS, like a custom header or footer.

My suggestion for the docs:


For example, adding this div to admin/index.html will cause the CMS to load within it:

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

privatemaker commented 5 months ago

Super. Thank you for clarifying. I incorporated that into the page 😄