As every user has different needs, the Front Matter extension allows you to extend the UI with your own custom elements and components which can be used in the Front Matter dashboards and the panel.
Front Matter CMS allows you to extend the UI in the following places:
- Card image
- Card footer
- Custom panel view
- Custom fields
Registering a custom UI extension
frontMatter.extensibility.scripts setting as follows:
The extensibility framework options
To enable development mode, you can use the
enableDevelopmentMode function. This will allow you to
reload the webview and open the developer tools without the need to reload Visual Studio Code.
Once the development mode is enabled, you will see the developer bar at the top of the webview.
Registering a card image
To register a custom card image, you can use the
registerCardImage function. This functionality
allows you to register your own image/element on the content card.
filePathparameter contains the path to the file which is being rendered in the card.
metadataparameter contains the metadata (front matter) of the file which is being rendered in the card.
Example of a custom image rendering:
Registering a card footer
To register a custom card footer, you can use the
registerCardFooter function. This functionality
allows you to register your own footer/element which will be rendered at the bottom of the content.
Example of a custom footer rendering:
Registering a panel view
To register a custom panel view, you can use the
registerPanelView function. This functionality
allows you to register your own panel view which will be rendered in the panel.
Example of a custom panel view rendering:
Registering a custom field
To register a custom field, you can use the
registerCustomField function. This functionality
allows you to register your own custom field which can be used when editing the front matter.
The custom field requires a bit more work, as it comes with a change handler for the field value updates. To make it easier, it is recommended to use for instance a library like lit to create your custom field.
Example of a custom field rendering:
Did you spot an issue in our documentation, or want to contribute? Edit this page on Github!