Query and Query Template (nesting)

Hey there,

since one of the latest updates the query-block itself is responsible for holding and providing the context of the query (if i’m not wrong).

What i wanted to achieve now is conditionally output a whole section based on that query. It’s about Job-Postings and I only want to output the section (holding the job-postings but also the section container, heading and so on) if there are open jobs in that company.

In my understand I would have to create the following structure:

  • Query
    • Section
      • Container
        • Heading
        • Separator (Div)
        • Query Template

The Problem is, that the Query-Template Block only accepts the Query Block as Parent block, which doesn’t allow the nesting I want to achieve.

I could put create the following Structure, but then the Section and the container element (with assigned padding to it) would still produce some whitespace on my site:

  • Section
    • Container
      • Query
        • Heading
        • Separator (Div)
        • Query Template

Bildschirmfoto 2023-08-02 um 15.45.09
Basically to achieve what I want to achieve, I have to put the query Template inside the Container here.

Please correct me if I’m overseeing anything @Louis (or anyone else :slight_smile: ).

Cheers
Wolfgang

Okay, interestingly, as is often the case, after writing this, I found a way to implement it. When I try to drag and drop it, it doesn’t work. However, if I right-click on the “Query-Template-Block” and select “wrap,” then use the “Container-Block” there, it works perfectly! :wink:

Of course you have to wrap the Container-Block with a Section Block then, but as a workaround it works pretty good! :slight_smile:

It’s not perfect though since it’s showing me that “Empty State of the Query Template” (which probably comes from the query-block as it expects the query-template to be a direct child of itself, i guess) in the Editor, but it works:

BUT: For some reason the mentioned Bug here (wasn’t able to check it yet, but it seems that it’s not working on my end) with Query Count > 0 Conditional Display appears again here. So it’s not outputting when applying the conditional Logic