ACF Pro: not all changes are outputted

Hi there!

I’m using ACF Pro and the layout builder to build my pages. I have my ACF field group setup as follows:

  • a select field
  • multiple groups that only appear when the right value is selected in the select field.
  • each group has three text-fields with default values

On the page I can then select what field I want to display. This works fine for the most part except for two things:

  1. The second value (I reordered the fields to check) always somehow shows the values of the previous selected field on the page. For example: on when I have the third field selected on my page, save it, and then select the second field, it shows the value of the third field. This only happens with the second field. Really weird.

  2. The second problem is that when the text fields are empty, it displays the old default values.

I tried both pulling the values directly from ACF Pro using dynamic content ({{dc:acf:post_field field="testimonialGroup_referentie"}}) and using loopers. Both give the same results.

I also made a video about the issue because I can imagine it sounds really vague: https://youtu.be/KomVeSibNgw

Hi Dagaloni,

Thank you for writing in, but sorry this is kind of confusing for us, can you tell us what page, what layout, and Global Blocks are involved? For now please audit all these things, and make sure there is no nested looper provider. It’s possible that there is one looper provider consuming 1 data, and when it gets to second looper provided the data is already offset by 1.

Thanks,

Thanks for the responds! I added al the information in the secret note. If you miss anything, please let me know. Did you watch the video? Hopefully that explains a lot.

Just to summarise: the first two values in the select field don’t output their values to the front-end page. What I see on the front-end page are the value of the previously selected field.

I’m pulling the ACF Pro values straight from the page, without a looper. So there’s no nested looper involved.

Hey @Dagaloni,

The issue only happens on the page you’re working on and it looks like it isn’t really an issue as you can update the ACF fields. Pro only outputs the field values of ACF.

What could have happened on that page is the values failed to update for some unknown glitch so the values got stuck. Pro has no contribution to the said glitch.

I created a test page and recorded a screencast showing that the first 2 values work fine (see the secure note).

Regretfully, you need to manually update the values on the page if the ACF Pro glitch only in your site happens again.

In case this happens often, alternatively, you can use Pro’s Element Condition instead of ACF’s. I believe you already know what I mean since you already used an Element Condition. Basically, the ACF part is just one select field then based on that field, you display a text element so in Pro, you have duplicated elements. One would show up based on the ACF field.

Hope that helps.

1 Like

Hi Christian!

I watched your video, thanks! Unfortunately is same problem happened on the test page you created. It’s really strange.

I give your idea a try. Do you mean creating duplicates of the testimonial element and then conditionally show the element based on an ACF Pro field? Besides this, is there a way in Pro to store values in a central place and selectively output the values?

Many thanks!:slight_smile:

edit: I reached out to ACF Pro for support and they pointed out that I was using the same fieldname which is probably conflicting some times.

Hi @Dagaloni,

I would suggest you follow the point mentioned by the plugin author, and let us know how it works for you.

Thanks

Hi tristup! Thanks for the reply. The thing is: since dynamic content doesn’t support variables, I’m not sure how to implement it.

All the fields are now called “groupTestimonial” and I’m pulling the data from ACF Pro using {{dc:acf:post_field field="testimonialGroup_referentie"}}. If I change each of the fields to “groupTestimonial_[unique-ID]” then I cannot use the dynamic content string in the layout builder since every page needs a different dynamic content string.

I was considering using [acf field="{$field_name}"] or <?php the_field('field_name'); ?> and then putting a dynamic content at the place of the field_name, but I couldn’t get either to work inside Pro.

Any suggestions?

Hey @Dagaloni,

I’ll go back to your questions for us to clarify things a bit:

Yes.

No.


Regretfully, since ACF pulls a different value still, you will need to follow the alternative solution. Solutions other than that would require custom development which is beyond the scope of our theme support.

Thank you for understanding.

Thank you for the clarification!

Hi @Dagaloni,

You are most welcome.

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