How can I use an ACF of type "image" in Cornerstone content?

I tried following the tutorial here https://www.youtube.com/watch?v=9NDlnEIBTUg but that does not seem to work for image field types.

NOTE: ACF = Advanced Custom Fields

Please help.

Hello AM,

Thanks for writing in!

When you insert the image into your custom meta or ACF field, the image url will be saved. Once you display it, you will need to make use of the image html within your text element or content area element like this:

<img src='{{dc:acf:field post="263" field="the_url"}}' alt='My Image'>

The the_url field is where the image url of the image is being saved.

Hope this helps.

Thanks for the reply, I am still running into the following issues:

I have an ACF field called customer_photo. Its field type is “image”. I am trying to use it as you have suggested but that does not work (please see the Test Page in my secure note below). I am using the following code in a Text Element:

<p>{{dc:acf:field field="testimonial"}}</p>

<img src='{{dc:acf:field field="customer_photo"}}'>

<p>{{dc:acf:field field="customer_photo"}}</p>

<p>{{dc:acf:field field="customer_name"}}<br />
{{dc:acf:field field="title"}}</p>

Hello AM,

The page cannot be viewed. You might have set this up as a private page. We need to login before we can see the page. Anyways, since you have used the shortcode inside a text element, you must update it and use this instead:

<p>{{dc:acf:field field="testimonial"}}</p>

<img src="{{dc:acf:field field=\"customer_photo\"}}">

<p>{{dc:acf:field field="customer_photo"}}</p>

<p>{{dc:acf:field field="customer_name"}}<br />
{{dc:acf:field field="title"}}</p>

The shortcode inside the image tag should be using escaped quotes.

We would love to know if this has worked for you. Thank you.

Sorry about the page being private. It is now public.

I made the changes you suggested but it still does not work. Please see what I am getting there. Will appreciate any help.

Hello AM,

I am still not seeing the page. It maybe in draft mode or privately published. Please provide us access to your site so that we can check your settings. Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thanks.

I am very sorry @RueNel that one of my colleagues made the page private. It is now public and you should be able to see it. Sorry for the trouble. Will appreciate a reply.

Hello AM,

The image were stored as an Array, you may have to display it using PHP coding instead.
Please check out this article as a guide:

This means that the image cannot be displayed using the Dynamic Content in the text element. Dynamic Content only works for simple text-based values.

Hope this explains it briefly.

@RueNel thanks for the follow up.

That seems to be a shortcoming. It will be great if the Pro Editor can enable to use of non-text fields from ACF as well.

You are most welcome.
As soon as the guys over at ACF will add the feature in this [ACF field="name"] shortocde, it would be easier for us to add it in the Dynamic Content.

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