Hi there!
I’ve added a repeater to a single Layout for a CPT like this:
add_filter( 'cs_looper_custom_my_acf_repeater', function( $result, $args ) {
return get_field( $args['field'] );
}, 10, 2);
and then added the field to json as @alexander described in this post
https://theme.co/forum/t/new-looper-providers-acf-repeater-field/84558/8
Repeater output works like a charm.
Now what I’m trying to achieve is to set a class on a span if a checkbox within the repeater-row is checked. Tried a lot of things, but I can’t get it to work.
Here is are my sub_fields:
The choice I set within the checkbox is
tao-canceled : Abgesagt
So it should output tao-canceled if checkbox is checked.
Here is the dynamic content I use
<span class="{{dc:looper:field key="canceled"}}">{{dc:looper:field key="date"}} {{dc:looper:field key="time"}}</span> {{dc:looper:field key="comment"}}
This would work if “canceled” were another textfield but that is too risky since it will be edited by different people.
So how can I get this to work? Do I have to register the Checkbox in the function? Or is there any other way to achieve this?
Cheers!