Backdrop needs a system to enable modules to easily and safely add views and layouts to a sites config folder. Then modules can add "Features" with a combination of views and layouts config files.
This can be done now by having the views and layouts in the modules /config folder which are automatically added to the sites config folder. An example of a WP blog "features" modules that will do this is here https://github.com/behindthepage/blog But the danger with this approach is that these files may over write files with the same name or create views and layouts with duplicate paths and the views and layouts are not removed when the module is disabled and uninstalled.
I envisage a system where a module can declare it's "addon" views and layouts and when enabled Backdrop checks that there are no naming or path issues and when disabled Backdrop disabled the views and layouts and deletes them when uninstalled maybe asking the user to confirm the deletion.
To make this work I suggest adding a hook_register_addons() function to the module's install file and having an extra folder in the module folder for the addon views and layouts.
So to modify my blog example The views and layout files would be in blog/addons
blog/addons/layout.layout.news.json blog/addons/views.view.archives.json blog/addons/views.view.news.json blog/addons/views.view.tags.json
and the function in the install file would be
function blog_register_addons() {
$addons['blog'] = array(
'description' => 'Provides a blog and archive pages.',
'config_files' => array(
'views.view.blog_news' => array(
'description' => 'Provides a blog view.',
),
'views.view.blog_archives' => array(
'description' => 'Provides an archive page and archive navigation block.',
),
'views.view.blog_tags' => array(
'description' => 'Provides a tags block.',
),
'layout.layout.blog_news' => array(
'description' => 'Provides a loyout for the blog page at /news.',
),
),
);
return $addons;
}
When the module is enables backdrop would check that there is no naming issues, warn of any path issues and copy these files into the sites config folder.
When the module is disabled or uninstalled a information pane would appear explaining what the views and layouts did and asking for confirmation that thay can be deleted. It could also explain to get them back you can just enable the module again.
I have used the name "addons" but it could be blog_register_feature() blog_register_package() or something else.
Related discussions: https://github.com/backdrop/backdrop-issues/issues/1045 https://github.com/backdrop/backdrop-issues/issues/881
What does everyone think?
Regards Geoff
Recent comments
I'm really hoping to make this simple change on new content types: https://github.com/backdrop/backdrop-issues/issues/7080 Let's disable the "Display author and date information" by...
February 26th, 2026 - Weekly Meetings
For our DEV meeting: an older bug needs (and could have) a fix. Issue #5729 - Views: Search Filter: On Empty Input "Show None" option Shows All There are 2 pull requests, but one...
February 26th, 2026 - Weekly Meetings
Ruby Text can be a bit of a hassle to edit... Yes, I can imagine that. No idea, how an editor dialog (or whatever) for easier editing of those should look like - in terms of...
Specific tags to work in CKEditor 5