Skip to content

Getting Started

shabib edited this page Nov 7, 2026 · 1 revision

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.

1. Requirements

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.

2. Download the Project

Clone the repository:

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

Alternatively, download the ZIP archive from:

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

3. Install the Example Theme

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.

4. Enable the Theme

  1. Sign in as an administrator.
  2. Navigate to Appearance (admin/appearance).
  3. Find Backdrop Theme Setup.
  4. Enable the theme.
  5. Open its appearance settings.

Direct settings URL:

admin/appearance/settings/backdrop_theme_setup

The settings page provides optional setup operations.

5. Prepare Native Backdrop Configuration

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.

6. Review JSON Configuration

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.

7. Import Taxonomy Terms

Taxonomy terms are defined in:

settings-content/taxonomy/terms.json

Before importing, confirm that the target vocabularies exist.

To import terms:

  1. Open the theme settings page.
  2. Find the taxonomy setup options.
  3. Select Import taxonomy terms.
  4. Save the configuration.

The library attempts to create the configured terms while checking for existing terms to reduce duplicates.

8. Import Sample Content

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:

  1. Open the theme settings page.
  2. Select Import sample content.
  3. 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.

9. Import Menu Links

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:

  1. Select Import menu links.
  2. Save the configuration.

The library supports menu link creation and parent-child relationships.

10. Update Views Taxonomy Filters

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:

  1. Select Update Views taxonomy filters.
  2. Save the configuration.

This operation updates existing Views; it does not create them.

11. Apply Layout Settings

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:

  1. Select Apply layout settings.
  2. Save the configuration.

The target Layouts and templates must already exist.

12. Configure Layout Blocks

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:

  1. Select Configure layout blocks.
  2. Save the configuration.

Review block removal operations carefully before running them on an existing website.

13. Flush Image Styles

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:

  1. Open the image style options.
  2. Select the required image styles.
  3. Save the configuration.

Only the selected styles are flushed.

The operation does not require a global backdrop_flush_all_caches() call.

14. Recommended Setup Order

For the first test, follow this order:

  1. Install the theme.
  2. Enable required modules.
  3. Ensure native Backdrop configuration is installed.
  4. Import taxonomy terms.
  5. Import sample content and files.
  6. Import menu links.
  7. Update Views taxonomy filters.
  8. Apply Layout settings.
  9. Configure Layout blocks.
  10. Flush selected image styles if needed.
  11. Review the results in the Backdrop administration interface.

Running operations separately makes it easier to identify problems.

15. Testing and Verification

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.

16. Known Limitations

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.

17. Next Steps

After completing the example setup, explore the other documentation pages:

Feedback

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.