This is something of a sequel to a previous question
I’m trying to create a set of UI tabs which I can call from anywhere within a Blueprint file.
Right at the moment, I’m having trouble identifying how to correctly link up all of the various files for the plugin.
Because a plugin involves multiple files and folders, I’ve set up a repo.
Long story short, I’m getting an error – Field "workflowtabs": The field type "inpagetabs" does not exist
.
And I can’t figure out why/where “inpagetabs” isn’t correct.
Any help would be massively appreciated.
Cheers,
Dan
Thanks for sharing your work-in-progress plugin repo. I’ve tried setting it up locally but failed due to several issues in the build setup. It looks like the configuration for the Vite/kirbyup build process you have set up depends on external setup due to the ../build
reference that points outside of your actual plugin. Also your src/index.js
imports inpagetabs-core.vue
even though the file is actually called inPageTabsCore.vue
.
I saw you linked to our “Custom Panel field” cookbook recipe as a base but the setup vastly differs, which makes it hard to get your plugin set up.
I’d recommend to first follow along the complete cookbook recipe to get a feeling for the setup. Then you can change the plugin to your desired functionality step by step.
PS: You can register Vue components directly in the Panel instance like this, no need to go through the Vue
global:
panel.plugin("your/plugin", {
components: {
"component-name": YourComponent,
},
});
Heya Lukas, thanks for your reply!
the ../build
reference that points outside of your actual plugin.
Ahh, there’s a weirdsie in either Vite or Kirbyup, where it uses the ‘src’ folder as its root for the build process, or something like that. Basically, if I take away the “…/” from the build reference, it creates a build recursion. See attached image.
And if I move kirbyup.config.js inside the ‘src’ folder as recommended (source 1, source 2), I get an error, build.outDir must not be the same directory of root or a parent directory of root as this could cause Vite to overwriting source files with build outputs.
I’ve tried re-pointing the Build reference in a couple of different ways, to see if I can get that to work. (One attempt of which included over-writing all of the plugin’s files).
I’m happy to add more files and folders into the repo to help folks like yourself install it… but I’ll need more specific guidance, if that’s okay?
**
Also your src/index.js
imports inpagetabs-core.vue
even though the file is actually called inPageTabsCore.vue
.
Well spotted. Fixed up in the repo. The hyphenated version is correct.
**
I’d recommend to first follow along the complete cookbook recipe to get a feeling for the setup. Then you can change the plugin to your desired functionality step by step.
Agreed, and that happened. This repo reflects my attempt to change the cookbook’s code step by step. I’ve made a mistake somewhere and I’m stumped.