Great!, this works very similar to my Solution discussed here Add Explicit Support for Multi-Section Pages. With the difference that this is notably more ordered and its integration with “kirby patterns” is great.
However, I think that the use of Controllers and Models are essentials for the Modules, It would be great if you add the support for that.
What would be your use-case for controllers and models? Since the modules are constrained to be displayed on one page only, I can’t think of one for models. Controllers might be useful though.
We are using it for a project where each page is pretty much unique. The layout of all pages is different. That’s where this makes most sense, because then we don’t have to create hundreds of templates but just a few modules that can be configured and rearranged however the client likes.
The plugin can also be used for simpler use-cases like a one-pager. The advantage is the same: The client can rearrange the content modules.
Kind of, yes. That’s why it is so useful to combine the Modules plugin with the Patterns plugin.
The Modules plugin now has its own Kirby extension registry for modules, which allows you to register modules from other plugins. Thanks to @dweidner for the idea.
http://localhost/localtest/kirbymodule/ is the root of my page and fullscreen-bg5.jpg is the image for the module. But the url is not correct for the image.
I have tested with your setup and can’t reproduce the issue. The “non-object” error generally occurs if the image does not actually exist. Have you verified that your module has an image with that file name (attention: not your displayed page, but your module page)?
Just to let you know that there is a bug when updating programmatically a structure field in Kirby if the modules plugin and at least one module is present.