Repository navigation
Getting Started
This guide explains how to install, configure, and test the Backdrop Theme Setup example theme.
Backdrop Theme Setup provides a reusable PHP library and JSON-driven setup operations for Backdrop CMS themes.
Project status: Proof of concept. Testing on a fresh local installation is recommended.
Before getting started, make sure you have:
- A working Backdrop CMS installation.
- Access to the site's themes directory.
- Administrator permissions.
- The required Backdrop modules enabled.
- A database backup if working with an existing website.
Some setup operations require existing content types, fields, vocabularies, Views, or Layouts.
Clone the repository:
git clone https://github.com/shabib-m/backdrop_theme_setup.gitAlternatively, download the ZIP archive from:
https://github.com/shabib-m/backdrop_theme_setup
Place the project inside your Backdrop themes directory.
The theme folder should be named:
backdrop_theme_setup
Example installation path:
themes/backdrop_theme_setup/
The theme should contain:
backdrop_theme_setup/
├── backdrop_theme_setup.info
├── theme-settings.php
├── includes/
│ └── theme-setup.inc
├── config/
│ └── [optional native configuration]
└── settings-content/
├── taxonomy/
│ └── terms.json
├── content/
│ └── content.json
├── menu/
│ └── links.json
├── views/
│ └── filters.json
├── layouts/
│ ├── settings.json
│ └── blocks.json
└── files/
The example theme uses the machine name backdrop_theme_setup.
The reusable library functions retain the theme_setup_ prefix.
- Sign in as an administrator.
- Navigate to Appearance (
admin/appearance). - Find Backdrop Theme Setup.
- Enable the theme.
- Open its appearance settings.
Direct settings URL:
admin/appearance/settings/backdrop_theme_setup
The settings page provides optional setup operations.
Before importing sample content or configuring Views and Layouts, make sure the required site configuration exists.
Theme developers can provide supported native Backdrop configuration files in the theme's config directory.
Examples include:
- Taxonomy vocabularies.
- Content types.
- Field definitions.
- Field instances.
- Views.
These files must follow Backdrop's native configuration format.
Important: Backdrop Theme Setup does not import the native config files itself.
Their installation and availability depend on Backdrop's configuration handling.
Ensure that the required configuration is available before running dependent setup operations.
The settings-content directory contains the setup definitions used by the library.
| File | Purpose |
|---|---|
taxonomy/terms.json |
Import taxonomy terms |
content/content.json |
Import sample content |
menu/links.json |
Import menu links |
views/filters.json |
Update existing Views taxonomy filters |
layouts/settings.json |
Apply Layout settings |
layouts/blocks.json |
Configure Layout blocks |
files/ |
Store sample images and documents |
Each setup operation is optional.
Theme developers can customize these files to meet their requirements.
See JSON Configuration for more information.
Taxonomy terms are defined in:
settings-content/taxonomy/terms.json
Before importing, confirm that the target vocabularies exist.
To import terms:
- Open the theme settings page.
- Find the taxonomy setup options.
- Select Import taxonomy terms.
- Save the configuration.
The library attempts to create the configured terms while checking for existing terms to reduce duplicates.
Sample content is defined in:
settings-content/content/content.json
Before importing:
- Confirm that required content types exist.
- Confirm that required fields exist.
- Import referenced taxonomy terms.
- Place referenced images and documents in
settings-content/files/.
To import content:
- Open the theme settings page.
- Select Import sample content.
- Save the configuration.
The importer creates sample nodes using supported field types and configured URL aliases.
Existing URL aliases are checked to reduce duplicate imports.
Menu links are defined in:
settings-content/menu/links.json
Before importing:
- Ensure the target menu exists.
- Check that destination paths are valid.
- Import any required sample content.
To import menu links:
- Select Import menu links.
- Save the configuration.
The library supports menu link creation and parent-child relationships.
Views filter settings are defined in:
settings-content/views/filters.json
The library resolves taxonomy term IDs dynamically and updates existing Views filters.
Before running this operation:
- Ensure Views is enabled.
- Ensure the target Views exist.
- Ensure the required displays and filters exist.
- Import the referenced taxonomy terms.
To update filters:
- Select Update Views taxonomy filters.
- Save the configuration.
This operation updates existing Views; it does not create them.
Layout settings are defined in:
settings-content/layouts/settings.json
The library can apply supported settings to existing Layouts, including:
- Layout templates.
- Page title display.
- Supported page title settings.
To apply the configuration:
- Select Apply layout settings.
- Save the configuration.
The target Layouts and templates must already exist.
Block configuration is defined in:
settings-content/layouts/blocks.json
The library supports operations such as:
- Adding blocks.
- Removing matching blocks.
- Moving blocks between regions.
- Updating supported block settings.
- Configuring block positions.
Before running the operation, ensure that required block plugins, Views, Layouts, and regions exist.
To configure blocks:
- Select Configure layout blocks.
- Save the configuration.
Review block removal operations carefully before running them on an existing website.
The theme settings page provides an option to flush selected image styles.
This can be useful after importing sample images or changing image styles.
To flush image styles:
- Open the image style options.
- Select the required image styles.
- Save the configuration.
Only the selected styles are flushed.
The operation does not require a global backdrop_flush_all_caches() call.
For the first test, follow this order:
- Install the theme.
- Enable required modules.
- Ensure native Backdrop configuration is installed.
- Import taxonomy terms.
- Import sample content and files.
- Import menu links.
- Update Views taxonomy filters.
- Apply Layout settings.
- Configure Layout blocks.
- Flush selected image styles if needed.
- Review the results in the Backdrop administration interface.
Running operations separately makes it easier to identify problems.
After completing the setup, verify that:
- Taxonomy terms were created.
- Sample content exists.
- Images and files are attached correctly.
- Menu links appear in the intended menus.
- Views filters reference the correct taxonomy terms.
- Layout templates are correct.
- Blocks appear in the intended regions.
- Image styles generate correctly.
Repeat selected operations to check duplicate handling.
Also test missing dependencies and invalid configuration files.
Backdrop Theme Setup is currently experimental.
The implementation does not provide:
- Automatic creation of all missing content types and fields.
- Automatic creation of complete Views through the setup library.
- A full content synchronization system.
- Automatic rollback of every setup operation.
- Guaranteed compatibility with every existing Backdrop installation.
Native Backdrop configuration can provide supported configuration objects separately from the setup library.
Additional validation and testing are needed before production use.
After completing the example setup, explore the other documentation pages:
Bug reports, suggestions, and contributions are welcome.
Repository: https://github.com/shabib-m/backdrop_theme_setup
Issues: https://github.com/shabib-m/backdrop_theme_setup/issues
Backdrop CMS: https://backdropcms.org/
This guide describes the experimental implementation. Configuration formats and behavior may change during development.