How can I retrieve the values of an array type field created with ACF Pro via Dynamic Content?

I have a problem with the ACF Pro integration and Cornerstone’s Dynamic Content

Practically…

I created with ACF Pro a Taxonomie type field filled with the values taken from the tags assigned to the post. In practice it is an array type field. Here everything works.

The problem is the display on the front-end of the result obtained.
I would like to display the textual content of the field and not the numbers that correspond to the tag id.

This is what I did:
I created this string via Dynamic Content in a Cornerstone text element

Tag: {{dc:acf:post_field field="rfm_tags"}}

This is returned:
Tags: 23,24,25,26

Instead I would like this:
Tags: happy, relaxed, dream

Is it possible to achieve this?

I hope I have been clear in explaining the problem.

Hey Daniele.

Thanks for reaching out!

Would you mind sharing your admin credentials so that we can check your setup properly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hi @marc_a, the site is currently under development on localhost. Should I rebuild everything on the online site?

I recreated the example on the online site and provided the login details as requested.

Hello Daniele,

You will need to edit your ACF Field and make sure that the return value is the Term Names and not the Term IDs.

Kindly let us know how it goes.

I had already tried to change this setting but it doesn’t solve the problem.
When changing, nothing is displayed on the front-end.

Hi @ruenel and @marc_a,

have you looked into my problem? There is a solution?
Thanks

Hey Daniele,

Sorry for the late reply! To display the terms name from your ACF field, you need to follow the steps below.

  • First, you need to set the ACF field taxonomy to Term Object. ( This will allow us to get the proper tag name )

  • You need to enable the Row as Looper Provider and the type is Dynamic Content, then add this dynamic content in the input {{dc:acf:post_field field=“rfm_tags”}}

  • Add a text element and set it to looper consumer, then inside the text element you should use this dynamic content {{dc:term:name}} to display the term names.

Hope that helps.

Hi @marc_a , thanks for the reply. One last thing, I would like the output of the elements separated by commas and on one line.

Like this:
Tags: happy, relaxed, dream

How you do it?

Hey Daniele,

I suggest that you add that you added comma that is inside a span, in your text element the content should look like this one {{dc:term:name}}<span class="tag-divider">,</span>.

Then in the element CSS, add this CSS code:

$el:last-child .tag-divider {
  display: none;
}
$el{
  display: inline-block;
  margin-right: 3px;
}

Please note that custom CSS code is outside the scope of our support. Issues that might arise from the use of custom CSS code and further enhancements should be directed to a third-party developer or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps.

Hi and thanks for the reply, the suggested solution works. But, I thought it could be solved without using custom css code.

So, I take this opportunity to suggest implementing a “php code” element in the next updates to allow a personalized processing of the data returned by the Cornerstone looper.

Hey Daniele,

I will add this to our feature request and we’re glad that the given solution is working for you.

Thank you.

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