@pranaysahith/decap-cms-widget-parent
v1.0.0
Published
A Decap CMS 3.0 widget for selecting parent folders dynamically from an Azure backend (scoped to /docs-site).
Readme
@glasswall/decap-cms-widget-parent
A Decap CMS 3.0 widget for selecting parent folders dynamically from an Azure backend, scoped to /docs-site.
Features
- Simple React control component ingesting CMS-provided field configuration
- Preview component (no-op / passthrough by default) you can extend
- Distributed as ESM + UMD via Vite library mode
Install
npm install parent-folder-widget
# or
yarn add parent-folder-widgetUsage in admin/index.js
import CMS from "decap-cms-app"; // or 'netlify-cms-app' if still on the old package
import { registerParentFolderWidget } from "parent-folder-widget";
registerParentFolderWidget(CMS);
// OR manually:
// import { ParentFolderControl, ParentFolderPreview } from 'parent-folder-widget';
// CMS.registerWidget('parent-folder', ParentFolderControl, ParentFolderPreview);Field Configuration Example (config.yml)
fields:
- label: "Section"
name: "section"
widget: "parent-folder"
hint: "Select the parent folder for this entry"
folderCollection: "docs" # custom option consumed by controlDevelopment
npm install
npm run devOpen the example at: http://localhost:5173/example
Build
npm run buildOutputs written to dist/ (ESM, UMD, and type declarations).
API
Exports:
registerParentFolderWidget(CMS)helper to register both control & previewParentFolderControlParentFolderPreview
Control specific props passed by Decap CMS plus any custom field options (e.g. folderCollection).
License
MIT (add a LICENSE file if publishing)
