Skip to content

Image: Shorthand syntax should enable functionality and UI for the lightbox #54635

Closed

Description

@artemiomorales

The following shorthand syntaxes are currently filtered out when specified in theme.json, so we are unable to use them for configuring the lightbox:

"settings": {
    "lightbox": true
}
"settings": {
    "blocks": {
        "core/image": {
            "lightbox": true
         }
    }
}

Presumably, these would be shorthand for the following:

"settings": {
    "lightbox": {
        "enabled": false,
        "allowEditing": true
    }
}
"settings": {
    "blocks": {
        "core/image": {
            "lightbox": {
                "enabled": false,
                "allowEditing": true
            }
         }
    }
}

The following values are likewise filtered out:

"settings": {
    "lightbox": false
}
"settings": {
    "blocks": {
        "core/image": {
            "lightbox": false
         }
    }
}

These could be shorthand for the following:

"settings": {
    "lightbox": {
        "enabled": false,
        "allowEditing": false
    }
}
"settings": {
    "blocks": {
        "core/image": {
            "lightbox": {
                "enabled": false,
                "allowEditing": false
            }
         }
    }
}

We should determine what needs to change in the codebase to allow for this shorthand syntax, determine what the behavior should be, decide whether we should indeed support the shorthand syntax or not and, if so, implement.

Activity

  1. added
    [Type] Enhancement
    [Block] Image
    [Feature] Interactivity API
    on Sep 19, 2023
  2. oandregal commented on Sep 27, 2023

    @oandregal
    Member

    I see how we want to make this more convenient in making it shorter, thanks for thinking about this. At the same time, I also see how some people would expect that lightbox: true to be unfolded into lightbox: { allowEditing: true, enabled: true }.

    Moreover, the lightbox feature only works for the image block, so theme authors would not have to write it more than once ever (either at the top-level or the block-level). It's not like they have to write it dozens of times for different blocks. Given all this, I don't think it's worth implementing at the moment.

  3. youknowriad commented on Oct 6, 2026

    @youknowriad
    Contributor

    Thanks for raising this! The team decided not to support a boolean shorthand for settings.lightbox. The lightbox only applies to the Image block, so the object form ({ "enabled": ..., "allowEditing": ... }) only needs to be written once, and lightbox: true would be ambiguous about which of the two flags it sets. The theme.json schema still accepts only the object form, so I'm closing this as won't-do. Feel free to reopen if a strong use case comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Image[Feature] Interactivity API[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions