Using Kirby Webpack Starterkit together with Sortable/Modules Plugin


#1

Hey there,

for a new project, i’d like to use the Kirby Webpack Starterkit from @pqml as mentioned in another Topic. But there seem to be some behavioral problems with either the Modules/Sortable Plugin.

With the Modules Field i get the following error:

And with the Sortable Field i get parse errors when i try to duplicate a page:

I normally don’t get this errors. Is it possible that with the Kirby Webpack Starterkit moving the site structure to a parent folder www/ is causing some problems? Did someone else have this problem in the past and could figure it out?


#2

What is the modules field? I only know the modules plugin and that is not installed in the fields folder, but the plugins folder.

BTW: when referring to (third-party) plugins, always post a link.


#3

Hey texnixe,

i’m referring to the Sortables Plugin (since this would be my optimum solution for now). I followed the Setup Instructions for the invisible modules Folder as said in the Modules Plugin GitHub and then set the fields options for the Sortable Plugin accordingly:

title: Section
pages: 
  template: section
  build:
    - title: modules
      uid: modules
      template: modules
files: false
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea
  modules_field:
    label: Modules
    type:  sortable
    parent: modules

i then get the parse error when trying to paste some module and get the strange error that i can’t sort the modules anymore when i dragged one of them…

Any Suggestions?

Kind regards Tobi


#4

What I was referring to was the first error message. It seems that you put the modules plugin into the fields folder instead of in the plugin folder. Maybe that also causes the second problem, but not sure.


#5

No i only have the modules Plugin in the plugins-folder and the sortable Plugin. Both plugins are registered in the kirby.config.json. What am i doing wrong here?


#6

I don’t know, I’m not familiar with this kit, but if you look at the error message in your first screenshot and where it is caused, it says/site/fields/modules/modules.php, so where does this come from if it is installed in the plugins folder?


#7

As i said i don’t get both errors together. Since i now only use the Sortable Plugin only the parse error occurs. I get an console error when clicking on the second (copied) one…See this GIF:

But i recognized that the new ones still have a dot in the uid but the first doesn’t:

And still some console error occurs before it goes to the parse error debugger but it’s too fast to read it…


#8

I just setup a fresh copy of the kirby webpack together with sortable and the modules. I also brought code from a site i know works fine with these plugins, with kirby 2.5.12 and it all breaks. Kirby webpack seems to mess with the way configs and stuff work out of the box. It’s late and im tired so maybe i made a mistake somewhere, but im pretty sure something in the way that kirby webpack works is interfering with the modules plugin.


#9

Okay Thank you Jimbo, since i was setting up so many projects with the same Plugins before i really was wondering what the hack happened there… So glad you ran into the same errors… :frowning:


#10

I just tested a fresh Webpack kit with just the sortable plugin (without the modules plugin) and it works without any problems, using your blueprint from above.

Maybe the problem is that your “modules” that are no longer modules have a prefix that is not defined in the blueprint? Only guessing here…


#11

But how else should I bre able to use the structure of the modules as recommended with a modules folder under /site?


#12

But didn’t you say above that you are not using the modules plugin anymore, only the sortable plugin? I’m confused.

Maybe you can provide steps to reproduce or provide the project as a .zip and send me a download link via PM.

Edit: I now added the modules plugin to the set and it still works without any problems.


#13

When i use the sortable Plugin without the modules structure under /site just by using default pages i don’t get the console error. But still get the parse error Debugger when i try to paste in a page (Button on the left next to copy). You don’t get this error?


#14

No, as I said, no console error and no PHP parse error. Kirby 2.5.12 and php 7.2.10.

I used the examples from the demo branch of the modules plugin, put them into site/modules. Then selected either the gallery or the text module when creating new modules via the sortable field.


#15

Hm then i don’t know. Could you send me the yml of the page you were using sortable on? Is it with the described build of the modules parent page? That would be very nice.


#16

It’s the code from above:

title: Section
pages: 
  template: section
  build:
    - title: modules
      uid: modules
      template: modules
files: false
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea
  modules_field:
    label: Modules
    type:  sortable
    parent: modules

And my modules.yml

title: Modules
pages:
  template:
    - module.text
    - module.gallery

#17

Hm i don’t know what i am doing wrong here. Same Blueprint same errors. Since i’m at the very beginning of the project, could you send me your ZIP for the whole Setup? That would be nice.


#18

When using modules, you should use the modules field instead of the sortable field, that prevents the dots when duplicating modules.