Adding key for ACF fields

Hi,

Is it possible to addd the key= for use with third party ACF fields not yet supported please.

In CCS we can use [field key=field_613195df5c499] but it is not supported in L&L.

Example:
I’m trying to add an image url field from the ‘ACF Image Aspect Ratio Crop Field’ plugin but can’t get it recognised in L&L with everything I’ve tried.
Field type is ‘acf_image_aspect_ratio_crop’ I can see all the fields in a var dump, but can’t seem to pick any up with L&L.

Update: Looks like I can grab the url in using the shortcode tag, which will work for now but I don’t think we can use an IF exists statement with the field this way. The Key would be great.

<Shortcode acf field="image_crop" />
<Shortcode field key=field_613195df5c499 /> if I have ccs installed

Thanks

Hi Gareth,

Thank you for the suggestion, that makes sense about supporting third-party ACF field types. I’ve made a note to look into it.

The attribute will probably be called acf_key, in case we add support for other kinds of custom fields in the future.

I found the ACF add-on you mentioned: https://github.com/joppuyo/acf-image-aspect-ratio-crop

It sounds like the field value will be some kind of array/object, so we’ll have to see what more is necessary to use it practically.

Anyway, I’ll update this discussion thread when there’s progress.

2 Likes

Hello, the Field tag now supports the acf_key attribute, added in version 2.0.6.

It accepts the “raw” ACF key starting with field_, like you described, or the field name.

For the Image Crop add-on, it looks like the field value is an attachment ID.

You can use it to create an attachment loop:

<Loop type=attachment id="{Field image_crop}">
  <Field url />
</Loop>

…or probably get the desired attachment field directly:

<Field url type=attachment id="{Field image_crop}" />
2 Likes

Thanks Eliot! Appreciate it.
I’m going to use this right now.

We can trust clients to upload images without resizing them. :wink:

1 Like