@webhandle/page-editor
v1.0.1
Published
Edit portions of a page
Readme
@webhandle/page-editor
Edit portions of a page
Install
npm install @webhandle/page-editorInitialization
import pageEditorSetup from "@webhandle/page-editor/initialize-webhandle-component.mjs"
let pageEditorManager = await pageEditorSetup(webhandle)Configuration
You can add the following structure to your configuration file:
{
"@webhandle/page-editor": {
"publicFilesPrefix": "/@webhandle/page-editor/files"
, "authorization": createRequireGroupMembership("administrators")
, "alwaysProvideResources": false
}
}However, authorization works a little bit differently. By default, only users from the "administrators" group are allowed to access the interface. This can be change like:
pageEditorManager.config.authorization = (req, res, next) => {
next()
}The above code would allow anybody to access the screens.
Usage
Turn on page editing for a page by doing:
__::@webhandle/page-editor/addExternalResources__