-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widgets: Add a 'Widget Box' container block #32723
Comments
Hi @ddryo. Thanks for the explanation and excellent diagrams. It will help to contain conversation about this to one issue thread so I'll close #29019 in favour of this one. Re-sharing what you wrote in #29019 (comment):
I think this is a neat idea and might be the best way forward. Some questions:
None of this is particularly difficult to implement as all of the underlying infrastructure is available already. We will need to think through the design and UX considerations, though, by creating a prototype and testing it with the design team cc. @critterverse. This will take a little bit of time and I am concerned that we do not have enough of it before the WP 5.8 RC 1 code freeze on June 29. Could this enhancement wait until 5.8.1 or 5.9? |
It does seem fairly late for the release process. A pattern seems like a reasonable option, though the widgets screens don't seem to support them currently. I could also see users needing a way to wrap a block already inserted. Maybe an option like the Group option, or a transform. |
Here are my thoughts. Point 1The most important point is that the "Widget Box" should be prepared separately from the Group Block. This is because their roles are distinctly different. Currently, all blocks are automatically wrapped in For example, the structure of a "Widget Box" block would look like this
( Written in block form, it looks like this
Point2You need a "title". This is what makes sense. Point3I don't think it makes sense to have a block pattern consisting of a Group and a Heading block. It is important to make the design of the widget consistent throughout the site. (As we have been able to do so far. Translated with www.DeepL.com/Translator (free version) |
|
I would also like to add the disadvantage of having the blocks in the widget area automatically wrapped with
Translated with www.DeepL.com/Translator (free version) |
Let me add an additional explanation for my opinion that "it's not a good idea to implement this in a Block Pattern".
Translated with www.DeepL.com/Translator (free version) |
See: #25174 |
While a block widget wrapper that somehow preserves the structure of widgets for blocks is a cool idea (be it with patterns, be it with a new block), it is not a given. This should be explored, but it is not a blocker for landing the widgets editor in WordPress 5.8 simply because all legacy widgets are fine. Managing to get blocks to look like the theme's sidebar content is indeed a lot more complicated without this widget structure. On the other hand users have options to style blocks which classic widgets forms did not provide, hence there was much more need for convention on wrapper for that kind of content. |
@draganescu Could you please be more concise? |
Howdy @ddryo ! Briefly I believe we should mitigate the problems of widget and block wrappers, but it is not a blocker for the widgets updates in WordPress 5.8. That's all :) |
@draganescu However, this is a very important and critical issue, if we release it in 5.8 in a vague way, won't it cause even bigger confusion later? If you feel that this is an issue that needs to be thought about a little more, I think we should think long and hard about it now, even if it means extending the blocking of the widget area first. |
I would like to raise one additional important issue. It is about the use of "Column blocks".There are many cases where you want to display multiple columns of widgets, for example in a footer widget area. Until now, many themes have done this by providing multiple widget areas. However, with the new block-based widget feature, you can use "column blocks". I was very excited about that. I was really looking forward to it, because it would allow me to create a variety of layouts with just one widget area. However, the current specification is not what I had in mind. The problemWhat I had in mind was to be able to build a layout like the following. However, in reality, the output has the following structure. I'll try to explain how this is a problem in a bit more detail. Concrete examplePlace the two "Legacy Widget" blocks inside a "Columns" block in the editor as follows At this point, the output I envision is as follows But in reality, it will look like this It seems that the title of Legacy Widgets without Columns is not given a (Even if the Instead of using Legacy Widget blocks in the Columns, I will use "Heading" blocks, "Categories" block, and "Archives" block, and add the The result will look like this As you can see, the design was broken even when using blocks. Translated with www.DeepL.com/Translator (free version) |
I understand that being blocked will give me more freedom. I am very excited about it. But if that is the case, I don't understand why all blocks are automatically wrapped by If we are going to get rid of the widget title feature for more freedom, I think the auto-wrap feature is getting in the way. (See the problem with the Columns block shown above.) Even if the "Widget Box" block implementation is put on hold, I think that wrapping it in |
Just to update here. We've been exploring two routes: Feedback one/both approaches would be much appreciated. |
Update - pattern-based approach is a "no go"Following lots of discussion and experimentation we've discovered that the pattern based approach is a "no go". Therefore, we're going to proceed with a new block, but this will be renamed to "Widget Group" ("Box" was always a working title 😄 ) and refined so as to provide the best possible experience. |
I am testing the new Widgets Editor at 5.8 beta-2.
Now, I have set up the sidebar in my theme as follows.
We then have the following CSS applied to
.c-widget
and.c-widget__title
.For example, if I have a "Text" widget and a "Category" widget in place, it would look like this
The theme unifies the design of widgets placed in the sidebar.
Problem
In the new Widgets Editor, I cannot recreate the structure of
.c-widget > .c-widget__title
in blocks unless you use "Legacy Widgets" block.Therefore, it is not possible to place new widgets using this unified design in blocks.
Try-1
If I try to use a heading block to place a title, it will look like this
Try-2
I added the
.c-widget__title
class to the heading block from the editor.Try-3
Use a "Group" block and place "Heading" and "Paragraph" inside. Then, give the Heading a
.c-widget__title
class.OK, I finally managed to place the widgets in the same design as before.
However, it is very time-consuming when you just want to place widgets "as before".
I find this to be a very important issue.
Will I have to enforce this procedure on the users of the theme in the future?
This is also related to issue #29019, but I've created a new topic to re-organize the issue.
The text was updated successfully, but these errors were encountered: