Problem/Motivation

Add a new ConfigActionPluginInterface plugin, setPropertyByTheme, that sets one or more config property paths to different values depending on the site's default theme (system.theme:default), falling back to a _default value when no theme-specific entry matches.

Motivation: recipes sometimes need theme-conditional config (e.g. CSS classes on a view display field) without duplicating whole setProperties blocks per theme, and without baking theme-specific values into the recipe's primary config action.

Proposed usage:

  config:
    actions:
      views.view.commerce_cart_form:
        setPropertyByTheme:
          display.default.display_options.fields.variation_alternative.list_classes:
            belgrade: 'belgrade-list'
            _default: ''

This way we can ship with generic recipes that will alter the output depending on the specific theme in use, satisfying multiple marketplace templates at once.

Scope:
- Plugin only, no new services/config schema beyond plugin discovery
- Resolves once at apply time (matches existing config action semantics - not reactive to later theme switches)

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

zaporylie created an issue. See original summary.

zaporylie changed the visibility of the branch 3609518---add to hidden.

zaporylie changed the visibility of the branch 3609518---add to active.

  • zaporylie committed ee9e7d4a on 1.x
    Resolve #3609518 "Add generic theme-aware config action plugin (...
zaporylie’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.