DUPLICATE: {query_results_count:[id]} inside Component always returns 0 on front-end

When using a Dynamic Data tag like {query_results_count:[element-id]} inside a component, the correct count is shown in the builder, but the front-end always displays 0, even when the query has results.

Steps to Reproduce

  1. Create a new component.
  2. Inside the component, add an element with a Query Loop that returns results.
  3. Copy the Bricks ID of the Query Loop element.
  4. Outside the Query Loop (but still inside the same component), add a text element using Dynamic Data: {query_results_count:[element-id]}
  5. Check the output:
    :white_check_mark: Inside the builder: Correct count is shown.
    :x: On the front-end: Output is always 0.

Front-end

HTML


The first section corresponds to the first element in the example above.

Inside builder

Additional Notes

  • I verified the Bricks ID and Dynamic Data syntax multiple times.
  • I tested by duplicating the component’s contents directly outside the component (which is the bottom example in the images). The non-component version works correctly, confirming that the issue seems to be isolated to components.

Hi Rick,
Thanks so much for your report.

The problem has already been reported, see #2:

We’ll update the original thread once it’s solved, and I’ll close this thread accordingly.

Best regards,
timmse

1 Like