NO BUG: {query_results_count:query_ID} not working with custom IDs?

Browser: Chrome 128
OS: macOS
Bricks: 1.12.4

Hi,

I want to query a specific post category, and show a section only if the respective query count is greater than 0. Now, when I change the ID of the element with the query loop, and use it like {query_results_count:customid} it returns with 0, but if I remove the custom ID, and use the last 6 characters of the bricks ID, then it returns with 2.

I checked the documentation (Dynamic Data – Bricks Academy), but didn’t see anything about custom IDs. Is there a way to use custom IDs and I just messed it up somehow, or would {query_results_count:ID} only work with the default given ID?

Ben

Hi Ben,
Thanks so much for your report!

The description in the Academy may be somewhat misleading. There are basically two types of “Element IDs” in Bricks:

  1. The CSS ID: #brxe-jyngwp
  2. The Bricks ID: jyngwp

As you can see, they are almost identical, with the difference that #brxe- is missing from the Bricks ID.

If you set a custom ID or rename the default ID, the Bricks ID remains, so we can uniquely identify the element.

The crucial point: the Bricks ID is used for {query_results_count:BricksID} - not the CSS ID.

Best regards,
timmse