Using {{dc:looper:count}} in Conditional Logic or in an Div ID causes Critical Failure

Hi folks,

I’m trying to build a little alert bar in our client’s header and would like to use the {{dc:looper:count}} to determine the number of alerts and hook them into a few different animations. But when I do this, the compile fails — or something.

I’m pulling these alerts out of an ACF Options’ Repeater — so maybe that’s the issue?

Would be great to be able to use the looper count in CSS classes and IDs! (or even conditional logic — that causes the issue as well).

Hi @lukefinsaas,

Thanks for reaching out.
The {{dc:looper:count}} always returns the total number of the item in the Loop and it will be the same all the time. I think you should use the {{dc:looper:index}} which outputs the specific loop number. Please find the following thread with a similar solution.

Hope it helps.
Thanks

Hi Tristan,

Initially, I said DUH! I realized, though, that we do want the Total Count of Looper Items. If it’s #alert-2, we’ll run animation #2; if it’s #alert-3, we run animation#3.

Unfortunately, adding {{dc:looper:count}} causes a critical error. Any other ideas of how we could accomplish this? I also feel that this should be added to a bug tracker.

Can you confirm you have this issue in 6.1.8? The repeater had an issue with the count, but it should be all good now in the latest release.

Sorry for the delay — NO!

Updating to 6.1.8 resolved the issue.

Thanks!

Hi @lukefinsaas,

Glad to know that the problem is resolved now.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.