Skip to content

Contributing

shabib edited this page Nov 7, 2026 · 1 revision

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.

1. Project Goals

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.

2. Ways to Contribute

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.

3. Before Opening an Issue

Please check whether a similar issue already exists.

When reporting a bug, include:

  1. Backdrop CMS version.
  2. PHP version.
  3. Relevant modules and dependencies.
  4. The setup operation involved.
  5. Steps to reproduce the problem.
  6. Expected behavior.
  7. Actual behavior.
  8. Relevant logs or error messages.

A minimal reproducible example is especially helpful.

Issue tracker:

https://github.com/shabib-m/backdrop_theme_setup/issues

4. Development Setup

Clone the repository:

git clone https://github.com/shabib-m/backdrop_theme_setup.git

Use 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.

5. Code Contributions

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.

6. JSON Configuration Changes

If you propose a new JSON property or configuration format:

  1. Explain its purpose.
  2. Provide a valid JSON example.
  3. Describe required dependencies.
  4. Define how missing or invalid values are handled.
  5. Explain what happens when the operation is repeated.
  6. Update the relevant Wiki documentation.

Whenever possible, prefer portable identifiers over installation-specific numeric IDs.

7. Testing Recommendations

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.

8. Pull Requests

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.

9. Design Principles

Reusability

Shared library functions should work with different theme machine names.

Native Backdrop APIs

Use Backdrop's existing APIs rather than duplicating functionality already provided by core.

Separation of Responsibilities

Use native configuration for supported site configuration.

Use JSON-driven setup operations for optional sample data and additional adjustments.

Administrator Control

Setup operations should be explicit and optional.

Predictable Behavior

Avoid unnecessary changes to existing content and configuration.

Targeted Cache Management

Clear only the caches required by an operation whenever possible.

Security

Treat JSON files and file paths as input requiring validation.

10. Future Development

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.

11. Community Feedback

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.

12. Project Links

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!