Put module blueprints and templates in separate folders inside site/modules to easily reuse and share them Preview draft modules on their respective pages with the native token you get via the panel preview link Autopublish modules Custom global module models Globally translatable headline and empty options Backwards compatibility for old modules in site/snippets/modules and site/blueprints/pages
Modules are subpages whose purpose is to provide the content for their parent container pages. Think of a page type “one-pager” made up of different sections (of course, such a website can consist of many such one-pager type pages, not just one).
While using normal subpages for this purpose works, you easily run into issues if the page has regular subpages as well.
The modules plugin helps to avoid such issues, by storing these “section/module” subpages in a separate subfolder, that you can then easily ignore when calling the normal subpages.
If you pursue such an approach without the plugin, you can of course do that, but then you have to create or own routes to prevent the modules folder and its children from being accessed directly via the URL.
Plus some other goodies… as listed above in the feature list.
Thus, the modules plugin is another approach to modularizing content and can be mixed with the page builder and the editor to give you maximum flexibility when building complex sites.
In case you have missed it: The builder is coming to Kirby’s core in the next big release.
@RustyDev The plugin registers templates and blueprints for the modules you add to the site/modules folder as e.g. module.text.yml and module.text.php.
So I think you should be able to create a template called module.text.json.php for the JSON representation. Maybe it’s a good idea to allow such representations in the site/modules folder
@thguenther After a local update to the latest Kirby release, I run into errors when using the Modules plugin. I have a bit of a strange arrangement on a website where a module has sub-pages and I used to run through the collection and output them on the parent site as a list. This worked till now with:
…and suspect I’m doing something rather stupid by perhaps using find() on the modules. I have the same problem when trying to output this module on the home page where I use:
Thanks a lot for the reply. Yes, I was pressed by time so I went and changed the whole logic of how I list the contents in this case (basically used no module) and solved the problem. I think your explanation is still relevant for future use and I shall keep that in mind. Thanks and thanks for the plugin!