Loopable wrapper element with no HTML output

Background

For these cases nested query loops with custom PHP is needed, while pagination e.g. show 12 posts per page won’t work with multiple loops. A simple query loop sorted by date and conditinally enabling the heading would (almost) satisfy the same requests in an easy to understand and efficient way.

Proposal
Provide a loopable wrapper element with no code output. It solely wraps elements any element given, also multiple ones, which can be conditionally shown/hidden.

Example uage
For the month divider a heading is conditionally enabled whenever the current post date starts a new month.

1 Like

Following the development of other builders, there might soon be one of the first with rather unrestricted query loop possibilities. A loop element which acts as an invisible (no code output) container seems the best solution to provide query loop functionality.
The current approach of Bricks, with a single root element and query loop enabled elements is restricted and leads to tedious workarounds like replacing whole loops with PHP or fiddling around with several layers of nested queries and still end up with a non-perfect solution.

It would be a huge deal for pro users, when the restrictions from the essential loops would be removed. With new builders on the horizon, this would be another point to ensure customers can be kept. I am sure many are not even aware of the impact of this feature request.

A loop element could even be the one and only element dealing with queries. Then no element needs this special loop parameter.

@Matej Ever considered that?

2 Likes

Hello @Maexxx,

thank you for the idea. I agree that this would be very nice (but not so easy to implement, if even possible the same was as the current query loop). I’ll present it internally, and we will discuss what we can do.

Thank you.
Matej

1 Like

I support you! :+1:

Yes, it’s a very interesting idea not to apply a loop to an element, but rather an element to a loop. If I understood the author’s idea correctly :slightly_smiling_face:

Crockoblock has similar functionality. You can set up any loops separately, and then apply them in the right places. I used it for Elementor once, but that was a long time ago…

1 Like

Exactly, and then you can even copy and paste the loops (element) without Bricks introducing another special UI or a fifth copy option. The loop element can automatically hold all existing queries and they could be reusable/selectable that way too.

That’s the only crucial improvement that I’m expecting from a Bricks 2.0, not a rating element.

1 Like