During development I had a bug where the method was called in the panel after a page refresh. Pretty messy because the modules plugin kicked in and printed all modules.
It seems to work fine now. Probably a development only bug. I will update the readme accordingly.
Another big update for the modules field. Itâs not finished yet but you can already get a good impression of what is possible.
With v2.2.0 I have splitted up the modules field in a more generic field named sortable. The modules field type is still in there and should work exactly like it has before.
What has changed
New core field type sortable
Own registry for variants (translations), layouts and actions
Easily extendable
I have added a demo branch where you can see how it works. Just copy the content of the demo branch into site/plugins/demo and you have your own demo field. For simplicity I only added some english translations.
There are still some things to do but I would be very happy to have some feedback or ideas of what is missing or can be improved.
Sadly there is no real documentation right now. But I am working on that .
I just added a demo field and I think I understand it. So the layout of single module entries can be totally customized, even with buttons and custom modal functions? Thatâs awesome
The demo field âstarâ button seems to add an unknown character to the title, at least in my installation:
But yes you can basically change everything if you want or need to.
Also you donât necessarily need the modules plugin. At least when you build your own extended field or use the sortable field on itâs own. You can set the parent page and or a template prefix in the blueprint.
This very week I was thinking how your plugin is perfect for managing subpages. Iâve used it for that ignoring other Modules features. Iâm super excited to give the new version a try. Love the flexibility you added to it
I just tried to find out if it is possible to have multiple modules fields in one blueprint or can I just have a single one? I think not right? Maybe you could add this to the readme.
@Andi-Lo
With the v2.2.0-beta it is now possible to have multiple field instances in one page. Right now it is not possible.
@pedroborges
I needed the functionality for product variants but also wanted to have modules at the same time . Please give it a try. And donât worry I will add the other translations as soon as possible
Awesome! Would like to try it out, but got some trouble installing it.
Have v2.1 running on my site and now want to try v2.2. I copied this into the folder: plugins/modules/ but will get the error in panel Method ModulesField::__toString() must not throw an exception, caught Error: Class 'KirbyModulesModules' not found so I think I have to do something differently than in the previous version?
Edit: Damn me. I got confused by the plugin âmodulesâ and the field âmodulesâ (yours). Now the error is gone, will see if more occurs
@lukaskleinschmidt Iâve not used your custom field yet but Iâm in need of product variants too. Could you perhaps share how thatâs done with your custom field?
I wasnât able to put something together because I got caught up updating the plugin. I will let you know when I get to it. But basically the variants are just supages that can be managed with this field.
Iâm proud to announce v2.2.0 of the modules field. To be honest itâs now called sortable. Beside the new plugin structure and the changed name there are some more goodies
Features:
new field types sortable and redirect (of course the modules field still exists)
own registry to extend and change the behaviour of the field
Iâm really happy how this version turned out. And hope you can pardon me the name changing .
The only thing to do when updating from v2.1 to v2.2 is to change the plugins folder name from modules-field to sortable.
hello,
have changed the foldername and get this error in panel:
PHP Fatal error: Call to a member function ui() on a non-object in /home/sven/workspace/kirby/site_/site/plugins/sortable/sortable/actions/add/add.php on line 30
PHP Fatal error: Call to a member function ui() on a non-object in /home/sven/workspace/kirby/site_/site/plugins/sortable/sortable/actions/add/add.php on line 30
There seems to be something wrong with the path here. There is a site_ directory in it. Is that the correct path?