Skip to content
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

Hide a block from being previewed on the front end. #13373

Closed
paaljoachim opened this issue Jan 19, 2019 · 4 comments
Closed

Hide a block from being previewed on the front end. #13373

paaljoachim opened this issue Jan 19, 2019 · 4 comments
Labels
[Feature] Block API API that allows to express the block paradigm. Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@paaljoachim
Copy link
Contributor

paaljoachim commented Jan 19, 2019

We can easily add a hide block option to the ... (three dots block option) contextual drop down menu.

Use Case: One tests out different layouts to see how they look. Instead of deleting blocks one could just hide them from frontend view. One might also need to test out various text and instead of deleting one can hide the block or blocks from view.
Thinking forward.
Making the title into a block that can not be deleted, but it can be moved around the layout. It can also be hidden from being seen on the frontend.

Here is how I see it.

From this:
screen shot 2019-01-19 at 18 22 42

screen shot 2019-01-19 at 18 29 19

To this:
gutenberg-hide-block-dropdown

A hidden block seen in the backend in Gutenberg:
gutenberg-hidden-block

This option could also easily hide the title block for being seen on the frontend. #4573

@mapk @jasmussen @melchoyce @jwold

@swissspidy swissspidy added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. Needs Design Feedback Needs general design feedback. labels Jan 22, 2019
@kjellr
Copy link
Contributor

kjellr commented Jan 28, 2019

Thanks for sharing, @paaljoachim. My initial reaction is that this seems to tackle a somewhat uncommon use case, and may not make sense to be included in core. It would on the other hand, make a fantastic plugin.

A small purely visual note to add: If we did pursue this, we'd need to aovid dimming out unused blocks: this convention is already used in "Spotlight Mode", so this would conflict.

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Jan 28, 2019

I do agree with you Kjell. At present time it will probably fit better in a plugin then in core.
I am closing this for now.

@brandbrilliance
Copy link

brandbrilliance commented Jul 11, 2019

This is something we might need to add to the gutenberg core. When I search for this feature, I can't locate anything do with Front-End hide/show, since all the plugins are focussed on actually hiding the ability to add a block from the Back-end user – which of course, is a completely different function that that of visibility in the front-end.

We don't want to hide the block from the client, we want to add the block to the layout, show the client how it will work and then "activate" the visibility on the Front-End, so they can quickly go-live. It might even be nice to show the block in preview mode somehow, but not on the front-end live page.

This is helpful when building pages for clients and as they bring their content.

@paaljoachim
Copy link
Contributor Author

Check out this discussion:
Allow users to hide blocks based on various contexts
#67661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants