Skip to content

Widget area discussion - should widget areas be blocks? #33254

Closed

Description

@talldan

What problem does this address?

In the standalone widget editor, widget areas are currently blocks. They're implemented in a locked template, with unlocked inner blocks areas.

There are several areas where using a block wasn't ideal:

  • Pretty much every feature on the block had to be disabled (reusable, html, custom classes etc.)
  • An experimental block supports property was added to hide the block toolbar
  • An experimental block supports property was added to hide the parent selector on child blocks
  • When a widget area is selected, a hack is in place to make the inspector show 'No blocks selected' and instead show a separate tab for details of the widget area.
  • The editor has some custom selection logic for inserting blocks into widget areas from the block library.

When you consider all of this, most of the block-y aspects of a widget area have been removed or disabled, so maybe they don't need to be blocks? What are the alternatives?

Activity

  1. added
    [Feature] Widgets Screen
    [Type] Discussion
    on Jul 7, 2021
  2. talldan commented on Jul 7, 2021

    @talldan
    ContributorAuthor

    A suggestion would be to only show one widget area at a time. That would mirror the way the customizer and the navigation editor work. I also feel that a downside of the current UI is that it requires a lot of scrolling. Especially if a theme has lots of widget areas or a user has added lots of blocks.

  3. noisysocks commented on Jul 8, 2021

    @noisysocks
    Member

    I was thinking about #32952 yesterday and wondering if we could add the multi-entity save flow to the Widgets Screen and make the Widget Area block an EntityProvider (with sidebar as the entity) so that saving widgets uses the same infrastructure that the site editor uses.

    This suggests to me that Widget Area should be a block, unless any React component can have an EntityProvider? (Not too familiar with how that stuff works.)

  4. noisysocks commented on Jan 27, 2022

    @noisysocks
    Member

    Using blocks makes it awkward for extenders: #32607

  5. noisysocks commented on Feb 4, 2022

    @noisysocks
    Member

    A suggestion would be to only show one widget area at a time. That would mirror the way the customizer and the navigation editor work. I also feel that a downside of the current UI is that it requires a lot of scrolling. Especially if a theme has lots of widget areas or a user has added lots of blocks.

    Reading this comment in 2022 made me think of the isolated template part editor.

    Screen Shot 2022-02-04 at 17 02 08

  6. noisysocks commented on Feb 4, 2022

    @noisysocks
    Member

    Using blocks means that we can't implement a Code Editor: #33518

  7. talldan commented on Feb 7, 2022

    @talldan
    ContributorAuthor

    Hmm, yeah, I guess Code Editor would have to be a widget area block feature.

  8. noisysocks commented on Feb 16, 2022

    @noisysocks
    Member

    Using blocks makes it so that pressing Tab selects the sidebar and not the first block in the widget area: #38260

  9. noisysocks commented on Oct 24, 2022

    @noisysocks
    Member

    Using blocks leads to issues with copy/paste: #41284

  10. t-hamano commented on Dec 11, 2022

    @t-hamano
    Contributor

    I submitted a new issue #45398 with copy/paste.

  11. youknowriad commented on Oct 7, 2026

    @youknowriad
    Contributor

    Thanks for starting this discussion and collecting the trade-offs. Since then the widgets screen has stayed with block-based widget areas and is only receiving maintenance fixes (for example #71110 and #75279), so this question isn't going to be revisited soon. I'm closing it. If a specific widget-area limitation is causing problems, please open a focused issue for it.

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

    [Feature] Widgets Screen[Type] Discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions