i have been trying to create a plugin to simple display on the navbar a lable with some custom text.
i have try'ed to use the wiki template but i get an error in octoprint saying that is is incompatible and i have python incapability (the icon is a small lightning bolt)
however
i got a clean sample code theat allow me using the template html to write "hello world" as a h1 tag but it shows in the bottom of the page.
another nood thing... i asked chat gpt, claude.ai, bard etc... for help and all the python 3 code they generate it giver error in octoprint.
i have instaled cookiecutter and played with the example it creates and it works but whenever i try to add any code to the generated file, octoprint does not recognise it...
so.. does anyone know of a video or tutorial on "how to create a plugin for octoprint for DUMMYS" ??
The hello world plugin tutorial kind of covers it. If you were to put your code up on GitHub or make available to review it might help us assist you in where things may not be linked up right. The python compatibility bit you mention is probably just missing a line like this.
here my git with the sample code
i am trying to activate an extrator pump/motor via the gpio ( i know about the octorelay) but i need other things... but the 1st thing is getting the button to work with octoprint
The issue you're running into about the navbar not loading is your adding the template as generic here. Change that to "navbar" and it should load the button in the top.
i know... it was just a test ,,, and sure unufe .... does not render
also i have created a new project where i was able to create a "config" page and when i add some text... anything to the sketeton.settings.jinga2 file the page will not render and it will put the plugin in incompatible mode.
although if your plugin_identifier is myplugin, and the file is named myplugin_settings.jinja2 it will autoload in the UI without the get_template_configs call.
but looking at your code, you're using jinja templating to try to change values, and that is really where the knockout binding stuff comes into play. Let me see if I can possibly provide you with a simple example of a plugin that has both settings and a navbar and you can see if you can make sense of it.
Take note that my get_template_configs call does not include the template file name like above. That's because they are named matching after the pattern <plugin_identifier>_<plugin_type>.jinja2.
The part that glues the backend to the frontend is the js file, and it's critical that your binding elements are configured correctly.