2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-27 21:26:43 +00:00

Panel mixin template (#392)

* Update panel.md

* Update panel.md
This commit is contained in:
Bben 2022-11-15 22:09:50 +01:00 committed by GitHub
parent ca1e47315d
commit 1f6b30faa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,10 +18,21 @@ Each plugin which implements this mixin can return zero or more custom panels fo
Panel content can be rendered by returning HTML directly, or by rendering from a template file.
Each plugin can register templates simply by providing a 'templates' directory in its root path.
The convention is that each 'templates' directory contains a subdirectory with the same name as the plugin :
* e.g. templates/myplugin/my_template.html
In this case, the template can then be loaded (from any plugin!) by loading "myplugin/my_template.html".
### Javascript
Custom code can be provided which will run when the particular panel is first loaded (by selecting it from the side menu).
## Example Implementation
Refer to the `CustomPanelSample` example class in the `./plugin/samples/integration/` directory, for a fully worked example of how custom UI panels can be implemented.
Refer to the `CustomPanelSample` example class in the `./plugin/samples/integration/` directory, for a fully worked example of how custom UI panels can be implemented.