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

Query Loop: Omit "No results found" message, if offset is used, and omit entirely if "No results" block is used. #66548

Open
2 tasks
jasmussen opened this issue Oct 29, 2024 · 4 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

When a custom query is applied that's using the "Offset" filter, the use case is commonly a template that has multiple query loops at once, including one that starts without an offset. For example, a "news" type layout:

In such a template, the first query loop will already show a "No results found" message. Perhaps it will even show a customized variant using the "No results" block. If you site has 1 or 0 posts, it is not going to be useful to see a repeated "No results" message, for every subsequent off-set loop:

Image

Duplicated "No results" blocks were, as shown above, already removed from the Twenty Twenty-Five News template. But the "No results found" message comes from the Query Loop block itself, and is output even when a "No results" block is used, being duplicative.

Suggestion:

  • Don't show the "No results found." message if there is a "No results" child block.
  • Don't show the "No results found." message if the query loop has an offset.
@carolinan
Copy link
Contributor

carolinan commented Oct 29, 2024

My only concern is that without showing anything, it can become difficult to see and understand that there is a query loop block there, so maybe it needs some sort of visual placeholder still, that takes up the space of the block and ensures that it can still be selected with a pointer like a mouse.

@jasmussen
Copy link
Contributor Author

Yes, we could potentially show a placeholder message, similar to what the Content block shows. Such as "No results yet; adjust settings to view." or ideally shorter.

@JosVelasco
Copy link

While building websites for customers, I find it difficult to explain how the website will look like when they don't have content.

Showing some fake demo posts/placeholders could be excellent with a "demo content" watermark on images and "demo content" titles and excerpts.

@jasmussen
Copy link
Contributor Author

Showing some fake demo posts/placeholders could be excellent with a "demo content" watermark on images and "demo content" titles and excerpts.

I think that's valid beyond any basic placeholder content for example the "Content" block shows. Careful balance to strike, though, as it's also valid to see how a template looks when your site only has 1 or 2 posts, for example.

You might also be interested in #28466, which suggests a way to "fill out with dummy content" a template, for previewing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants