Is there a plan for a conditional block?
Can you share more details about your idea? How do you see it working exactly? Is there any particular use case you have that it would solve?
Hi Greg,
If you're familiar with ACF, you may already use it quite a bit.
Say you have a Landing Page, and you have a variety of blocks dealing with your business. In a list maybe they're like:
But, you want to only show 1 and 4 if the business is a brick and mortar.
So you have a toggle at the top asking "Does your business have a physical location?"
I the answer is yes, the blocks 1&4 would be programmed to display.
That would be an example of a conditional.
There are likely better examples, but that's just what I was able to think of at 2am.
Related: There is already a plugin called Block Options https://wordpress.org/plugins/block-options/
@Soean Eh... Doesn't look like all that much really.
One, I'm not a fan of adding more plugins for something that I think people will ultimately want natively.
Two, the conditional component to that plugin requires the user to actually write PHP and use WordPress functions (this may be something you and I can do, but not practical for an end user).
I appreciate you suggesting something, but this doesn't really come close to a solution for what I'm proposing/asking about.
@bahia0019 I know its not a perfect solution, I just wanted to post it as an example https://block-options.com/features/. So you should see it more as an Inspiration. I like to see this kind of feature in core.
@Soean Thank you very much for suggesting Block Options! @bahia0019 you can use the Display Logic option to add conditional statement. I do have more features that will be very helpful for what you are looking for. Will keep you posted once those features are available. Cheers!
Closing, as it seems like this can be addressed with a plugin for the time being.
@bahia0019 I've decided to add ACF support already to Block Options plugin :) I haven't uploaded this feature yet but here's the preview. Let me know if you're up for testing. Thank you very much!

@phpbits I don't understand what that is supposed to do.
My suggestion was to include native conditional logic AND eliminate a dependency on ACF.
@bahia0019 sorry, I misunderstood! I thought you are looking for a way to make the block visibility dependent on ACF.
I do believe a conditional block would be great to have for various elements of a page that we would like to define where these are to be seen. Inside a conditional block one could add a sidebar/footer/menu/header or any other block.
Btw Perhaps even add conditional logic to the container block. (I am not able to find the issue for the container block right now.) The container block is meant to have child blocks inside of it.
It would be great to add a phase two label to this issue @danielbachhuber @melchoyce
@paaljoachim this is intriguing!
How exactly would the conditional logic work in this case? My concern is that the steps shown above might be a bit much for the use case we've been discussing on the Make blog. If I'm going to add a conditional block, I more care about just saying "this goes across the entire site".
I welcome thoughts on this! At the moment it feels like the use case for conditionals might need some tweaking to fit for something such as the nav block.
Thanks!
Hey @jwold
Most blocks have an advanced area in the sidebar settings. I would suggest that we actually use it. (Today it seems to mainly be used to create another CSS class.)
How to easily setup conditionals is something we will need to look closer at.
Here is a suggestion.

By using the Advanced section.
Adding a Where to show Container Block.
Then an accordion listing all pages. Another listing posts.
Then an is user logged in.
This is what it could look like when open. Clicking the Pages accordion then shows all the pages. User clicks the pages and they get listed next to the Pages title showing which pages the container will be seen in. Similar to when selecting a color one sees the color preview tiny box next to the color background title. As it gives an overview of what has been selected.

Of course I am probably missing conditionals that should be added, but it gives a nice overview of how I see it can be done.
Ok, this is becoming clearer to me. Thanks for clarifying!
This is what it could look like when open. Clicking the Pages accordion then shows all the pages.
For a use case, I just wanted to add a couple of thoughts based I'm something I'm looking at doing:
Alert or warning based on connection to another site such as weather alerts. ifAlert then displays block(s) with a warning and possibly recommended actions.
Display of block based on user conditions (Role/permissions, number of posts created, pending posts to review, pending comments, etc.) Some functionality already exists but could be created without adding more plug-ins.
If a conditional engine is built, with maybe a few conditions to start, others may create add-on conditions just as others are now coming up with add-on blocks. In fact, some creating specific blocks, such as a weather type block above, might come up with their own conditions specific to the block they designed.
Just adding more thoughts.
Thanks!
Ken
Wicked Block Conditions can be used to show or hide blocks based on conditions like user login status and role.
Wrote another plugin today. maybe helpful for someone.
Very early development. Not production ready.
Only to condition types by now: true, currentUser.
Condition types are pluggable via js/php filters.
Supports nested conditions.

No docs yet.
How to add new condition types? Check implementation for existing type currentUser:
I wrote a plugin to show/hide Gutenberg Blocks called "Block Logic".
You can find it here:
https://wordpress.org/plugins/block-logic/
It is very flexible and supports hiding/showing of blocks based on all sorts of conditions or functions, even your own function, should you want to write one.
Would be happy if anyone finds it useful!