SOLVED: Container with Query to have wrapper

I feel like it would be beneficial for Containers that have the “Use Query Loop” option selected to have a wrapper to go around the looped items.

One logical reason for this would be for building layouts with CSS grid.

Eg.

<div id="brxe-oogelq" class="brxe-oogelq brx-container">
    <div data-loop="0" class="brxe-zlvquh brx-container">
        <h1 data-loop="0" class="brxe-otniow brxe-post-title">Book 3</h1>
    </div>
    <div data-loop="1" class="brxe-zlvquh brx-container">
        <h1 data-loop="1" class="brxe-otniow brxe-post-title">Book 2</h1>
    </div>
</div>

Hi,
I actually agree that most of the time, a container is needed for layout purpose, but if you need it, just add it :wink:

When container is not needed, it is good to not add a useless one.
For instance, when using slider librairies on query loops, it is sometimes good to not have one.

And also, for styling purpose, you need to separate the wrapper container and the loop container so that you can use classes or style id separately :wink:

1 Like

I did actually think about this as well. You are 100% right that it would work in most circumstances to just add a container. I’ll explain my particular use case a bit more so you can see why I want it.

I’m toying with the idea of building a Search & Filter Integration (See Below). Part of that integration needs an ID or Class to go onto the wrapper of the query loop so that the plugin knows what html it needs to replicate. In order for it to be as simple as possible, I wanted to programatically add that class to the wrapper. But if there’s no wrapper, I’m stuck before I start.

I understand that my use case is a bit unique and that native filtering is on the feature request list. So perhaps all of this is a moot point in the end. I really wouldn’t be offended if I didn’t get my way. :stuck_out_tongue:

1 Like

I’m actually trying to do the same without plugin, using the WP REST API.
But it’s a long and fastidious way, I’d rather wait for the filtering feature as well :rofl:

@yankiara We can team up on this. I am also trying to achieve the same. WPGridBuilder is the only plugin which I use in my site right now. I want to go plugin free.

After reading more about the history of Bricks, it seems like the removal of unnecessary divs was intentional and as such, I feel like this request goes against the nature of Bricks in general.

Plus, considering there is native filtering on the roadmap, it’s probably not worth anyone’s time looking into this further. I will mark this as solved.

Edit: hmm, I guess I can’t do that myself? If anyone can, feel free to do it for me. :slightly_smiling_face: