SOLVED: Query Loop Container ID not available on front

Bricks Version: 1.4.0.1

Not sure if this is a bug or not but it is a bit confusing nonetheless. Steps to reproduce:

  1. Create Container
  2. Set custom ID for container
  3. Turn on “Use Query Loop” + configure as desired
  4. Save page and go to the front end
  5. The custom ID is nowhere to be found because the wrapper is gone.

This is somewhat related to the feature post that I made previously. I’m kind of impartial now but still find this functionality a bit confusing. Maybe the ID field should be hidden on containers if this is the desired functionality. I’ve included a link to that post below for reference:

Edit: I see that the original ID is used in the query loop and also applied as a css class to each looped item, but setting a custom ID doesn’t seem to do anything at all.

Just tested. it is not working and totally breaking the layout.

1 Like

Hi Stew,
as soon as you apply the query loop to the container, the (default)ID becomes the class, since an ID may only occur once. Of course, this should also be the case if you use a custom ID. I have added the problem to our bug tracker.

In the meantime, if you just leave the default ID, it will work without problems.

Best regards,
timmse

1 Like

Hello @cmstew

We’ve fixed this in Bricks 1.5 RC.

If the fix isn’t working as expected, please let me know here.

Thank you!

Luis

Hi, I can confirm that in 1.7.3 IDs are still converted into classes. It would be great if we could keep unique IDs in a query

“IDs are still converted into classes

This is intended, from what was said above.

It would be great if we could keep unique ID s in a query” - You can add IDs to the elements using the custom attributes if you need IDs for some reason. The attribute value allows dynamic data, for example each ID could be the post_id. I’m not sure how it would be useful, but the option is there.

2 Likes

You can add IDs to the elements using the custom attributes if you need IDs for some reason. The attribute value allows dynamic data

Perfect, thanks!