tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
198 stars 23 forks source link

No Results block has no HTML #1452

Closed diggeddy closed 2 weeks ago

diggeddy commented 2 weeks ago

Description

This is about the only block in the plugin that returns no HTML and yet occupies a space in document. I assume this is a bug, and it should be a Container Block variant. Whichever way, it should have some HTML for styling (?)

tomusborne commented 2 weeks ago

The No Results block is a bit of an outlier. It doesn't output any HTML on the frontend. It exists to add logic to the frontend of whether or not its contents should display.

Ideally, we should have a block visibility system that can handle this sort of thing, but that's another discussion.

I don't love creating a new "block" to do this, but I extra don't love the thought of adding random visibility logic to the Container block that we won't need in the future.

diggeddy commented 2 weeks ago

For now users can add the extra container within if required so no big shakes. Lets close this and we can pick up discussions on Block Visibility options in a separate issue.

tomusborne commented 2 weeks ago

The alternative is that the Query block simply has a "no result" text control where users can add a simple message.