Disable Query Loop previews in builder, or display only the first result, for performance reasons

Hi gang.

Forgive me for yet another “this is a thing in Oxygen, but it’s not a thing in Bricks, and maybe it should be” post. I’m loving Bricks. It’s fantastic.

I’m working on a page with about a dozen Query Loops. Some of them return more than 10, 20+ items (data from 150+ custom posts).

When you have more than a handful of Query Loops on a single page, each outputting a decent number of items, the builder slows down to an unusable crawl.

It would be fantastic if we could set the loops to NOT display all the items being queries, or to just display the first result for formatting/styling purposes.

In Oxygen this was archived by switching the Repeater to “Single” mode, not “Normal” mode — where Normal mode displayed all items being output by the Repeater, and Single just displayed one.

If there is a way to do this presently and I’m missing it, please let me know. Or if there’s a hacky temporary way to fix this to allow for better management of pages with multiple Query Loops that severely impact performance, I’m all ears.

Edit: after doing a bit more digging and finding this post, I did a bit more playing around with plugins and performance.

A decent amount — but not all — of my performance issues seem to be tied to having tons of classes in play in the builder (both from ACSS and my own custom classes). Disabling ACSS helps a little bit, though it obviously breaks my layout.

However, even with ACSS disabled, my page with 10+ Query Loops is still pretty slow. I think having a way to disable QL output in the backend would still be a performance boon.

4 Likes

Workaround: Brings single mode - Limiting the number of posts to 1 in the editor - BricksLabs

That’s great, is there any possibilities to make it works with all of query loop by default?
so we don’t need copy the id when added a new query loop and adding it again to the function

Updated the post to answer your question.

I don’t see any changes on the post, btw i think we just need to exclude the condition for checking the $element_id, am i right?

Correct.

1 Like