BUG looper empty

hello,

i have a slider that gets its data from a sacf options page.
i made a div in which the slider container is. the div is the looper provider ({{dc:acf:option_field field=“sl_st_head”}}).
the slide 1 is the looper consumer. everything works so far. i get all the data.

but now i wanted different images depending on max-width.
i entered the code in element => customize => element css:
@media (min-width: 768px) {
.custom-div{
/* Desktop background photo */
background-image: url(’{{dc:looper:field key=“sl_st_head_desk”}}’);
}
}

@media (max-width: 767px) {
.custom-div{
/* Mobile background photo */
background-image: url(’{{dc:looper:field key=“sl_st_head_mob”}}’);
}
}

i also tried this one:
@media (min-width: 768px) {
$el {
/* Desktop background photo */
background-image: url(’{{dc:looper:field key=“sl_st_head_desk”}}’);
}
}

@media (max-width: 767px) {
$el {
/* Mobile background photo */
background-image: url(’{{dc:looper:field key=“sl_st_head_mob”}}’);
}
}

the acf image filed returns me the image id. so that should fit.
unfortunately the looper output is empty.
the looper itself works, if i enter {{dc:looper:field key=“sl_st_head_desk”}} in a textfield i get the image id…

can you take a look at this?
thanks in advance

1 Like

I have a feeling you are having a similar issue to this. The issue being, your output is something similar to. background-image: url(--generated-var); which is not valid. The var needs to capture the url() part on our end. Of course just having breakpoint controls for the background-image would be nicer. If that’s not the case what is the output of your element CSS? The following can help.

add_filter("cs_debug_css", "__return_true");

We have some steps forward coming with breakpoints in 6.3.0, so I think we’re getting closer to that reality and will make sure we take a look at this after 6.3.0.

hi,
yeah it seems it is a similar problem.
so i can use:

background-image: url(’{{dc:looper:field key=“sl_st_head_desk” type=‘image’}}’);

or i am wrong?
thanks again for your help.
is there any plan to make real dynamic breakpoint images? so the images will not load when the breakpoint is hidden?

So that constant in the linked thread will output all element CSS dynamic content as a string. Instead of creating a variable. The downside is you lose the isVar system and no parameter variables are outputted. I played around with getting url() to work properly today. Still some work to do, but I think we might be able to see it in 6.4. Have a great weekend!