-
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
List View: Explore hiding blocks #50756
Comments
In conjunction with configurability in the block properties sidebar, this would also be very useful for:
Of course there is the tricky part where when a condition changes internally (ex: date/time change) you may need to tell the caching plugins (such as the WP Super Cache plugin) to invalidate their cache for a particular page... Yeah sure, there's the aforementioned "Block Visibility" plugin out there in the meantime, but it would be architecturally cleaner to have it as a built-in Gutenberg feature, and also it would be better for long-term viability instead of running into plugin problems… |
I explored this a bit and it seeme achiveable by adding a system attribute (hidden) which causes the block edit to not render and the block render callback to skip the block via a render callback hook. Skipping the rendering of the block edit keeps the block in the list view. For static blocks we can use |
Love this idea! I think I would need it every week somehow. Really miss it in comparison to other CMS. |
Yes, please! This would be a fantastic improvement that would enable a more flexible pattern/block design. For instance, in the product gallery pattern in Woo, we'd bundle a few extra blocks that may not necessarily be part of the basic design, like product name, ratings, share buttons, etc. To achieve this right now, we'd have to build a separate block and add extra visibility settings in the inspector. Hiding blocks would simplify the structure (we'd rely on templates and template parts, not individual blocks) and help us surface different block configurations using more interesting/opinionated pattern layout variations. |
It could potentially be an option you turn on within editor preferences; as it's more of a builder flow than an everyday user flow. |
All for hiding items on list "view", for granular view control. |
To complement #33583, it would be interesting to have a way to hide a block within the editor, which results in the block not rendering on the front end.
If we could visually hide a block in the editor, and stop it from rendering on the front end, designers could lay out a couple iterations of an idea—turning on/off various groups—instead of various process hacks to exploring today.
Some ways I achieve this now are to leverage the undo button (or copy/hold in the clipboard)—but it only goes so far. Otherwise, I've ended up creating reusable blocks of ideas I don't want to loose, or random pages with groups of blocks on them. Not ideal.
Proposal
Consider having a hide/show control available within List View, that shows up with the same conditions as the block options control that's already in place. When toggled on, that block does not render within the editor or the frontend of the site.
Visual
The text was updated successfully, but these errors were encountered: