Repository navigation
Contributing
Thank you for your interest in Backdrop Theme Setup!
Backdrop Theme Setup is an experimental project exploring reusable, JSON-driven setup operations for Backdrop CMS themes.
Feedback and contributions from Backdrop developers, theme designers, testers, and documentation contributors are welcome.
The project aims to:
- Reduce repetitive PHP setup code in Backdrop themes.
- Make optional sample content imports easier to implement.
- Reuse Backdrop's existing APIs and configuration system.
- Support portable configuration that avoids hard-coded entity IDs where possible.
- Give administrators control over setup operations.
- Make theme development more approachable for designers.
- Encourage discussion about reusable theme setup workflows.
The library is intended to complement Backdrop Configuration Management, not replace it.
You can contribute by:
- Testing the library on different Backdrop installations.
- Reporting bugs.
- Reviewing PHP code.
- Suggesting API improvements.
- Improving JSON validation.
- Writing automated tests.
- Improving documentation.
- Proposing additional reusable setup operations.
- Reviewing compatibility with Backdrop core and contributed modules.
Contributions do not need to include code.
Detailed bug reports and practical feedback are equally valuable.
Please check whether a similar issue already exists.
When reporting a bug, include:
- Backdrop CMS version.
- PHP version.
- Relevant modules and dependencies.
- The setup operation involved.
- Steps to reproduce the problem.
- Expected behavior.
- Actual behavior.
- Relevant logs or error messages.
A minimal reproducible example is especially helpful.
Issue tracker:
https://github.com/shabib-m/backdrop_theme_setup/issues
Clone the repository:
git clone https://github.com/shabib-m/backdrop_theme_setup.gitUse a local Backdrop CMS installation for development and testing.
A fresh installation is recommended when testing import operations.
Before testing, review the theme's native configuration and JSON files.
Do not use a production website for experimental setup operations without a backup.
When proposing changes:
- Follow Backdrop CMS coding standards.
- Use Backdrop APIs where available.
- Keep the reusable library independent of a specific theme.
- Preserve the
theme_setup_prefix for shared library functions. - Validate paths and configuration input.
- Avoid unnecessary global cache flushing.
- Consider existing site data.
- Document new dependencies.
- Explain how the change can be tested.
Keep theme-specific UI logic separate from reusable library logic whenever practical.
If you propose a new JSON property or configuration format:
- Explain its purpose.
- Provide a valid JSON example.
- Describe required dependencies.
- Define how missing or invalid values are handled.
- Explain what happens when the operation is repeated.
- Update the relevant Wiki documentation.
Whenever possible, prefer portable identifiers over installation-specific numeric IDs.
Test both successful operations and failure cases.
Useful scenarios include:
- Fresh installation.
- Repeated import.
- Missing JSON file.
- Invalid JSON.
- Missing content type.
- Missing field.
- Missing vocabulary.
- Missing taxonomy term.
- Missing View or display.
- Missing Layout or region.
- Existing URL alias.
- Existing menu link.
- Missing image or file.
- Invalid image style.
Also test whether the operation leaves existing site configuration unchanged when required dependencies are missing.
Before submitting a pull request:
- Keep the change focused.
- Explain the problem being solved.
- Describe the proposed implementation.
- Include testing instructions.
- Update documentation when behavior changes.
- Mention any compatibility or migration concerns.
Small, focused pull requests are easier to review.
Shared library functions should work with different theme machine names.
Use Backdrop's existing APIs rather than duplicating functionality already provided by core.
Use native configuration for supported site configuration.
Use JSON-driven setup operations for optional sample data and additional adjustments.
Setup operations should be explicit and optional.
Avoid unnecessary changes to existing content and configuration.
Clear only the caches required by an operation whenever possible.
Treat JSON files and file paths as input requiring validation.
Possible areas for future discussion include:
- JSON schemas and stronger validation.
- Better error reporting.
- Automated SimpleTest coverage.
- Improved duplicate detection.
- Rollback support.
- Additional field types.
- More flexible Layout configuration.
- Improved dependency handling.
- A possible contributed module implementation.
These are discussion topics rather than confirmed development commitments.
One important question is whether the current theme-integrated library approach is the best long-term solution.
Feedback is welcome on alternatives, including a dedicated contributed module or closer integration with Backdrop's existing configuration and installation workflows.
The goal is to find a practical solution that benefits both theme designers and site builders.
Repository: https://github.com/shabib-m/backdrop_theme_setup
Issues: https://github.com/shabib-m/backdrop_theme_setup/issues
Backdrop CMS: https://backdropcms.org/
Thank you for helping improve Backdrop Theme Setup and supporting the Backdrop CMS community!