Extend CMS With Custom Functionality
For any cases where GrpahQL CMS for some reason can't fit with your requirements, you can provide custom React component with custom functionality.
Here is how it works:
<Route
path='/graphql-cms'
endpoint='/graphql_cms_endpoint'
graphql='/graphql'
newMenuItems={customPages}
components={GraphqlCMS}
/>
On client side add new property newMenuItems
to CMS component in which we will pass array with new React components. In our case it is customPages
.
class CustomDashboard extends React.Component {
render() {
return (
<div>place for your custom component</div>
);
}
}
let customPages = [
{
label: 'Custom Page',
secret: 'uniqeForEachComponentSecret',
view: {
secret: 'sameUniqeComponentSecret',
component: CustomDashboard //your custom React component
}
}
]
The above code will generate new side menu point as seen on the screenshot below:
All custom pages will have first priority for the side menu order and will show above other menu points.