Skip Navigation

[Résolu] Display ACF image field in Toolset archive loop

This support ticket is created Il y a 2 années et 8 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 réponses, has 2 voix.

Last updated by webD-3 Il y a 2 années et 8 mois.

Assisted by: Shane.

Auteur
Publications
#2140357

CPT "team" is created in Toolset.

I am using a custom field "team-headshot" from Advanced Custom Fields, particularly because I am using the "Advanced Custom Fields: Image Aspect Ratio Crop" plugin, which allows my end-users the ability to crop a newly-uploaded photo the exact specs required.

I also have another ACF custom field "team-role" which is a simple text field.

I was able to make these two fields available to Toolset by going to Settings > Front-End Content > Hidden custom fields.

I am successful in adding the "team-role" data to a Paragraph block in the WordPress Archive Loop, by selecting Dynamic Sources, Content, and Current Team Member. "team-role" is available in the dropdown and it displays as expected.

However, I cannot seem to do the same with the "team-headshot" image. The full listing of fields/custom fields is available when adding a Paragraph block, but when I add an Image block - either the default Gutenberg image block or the Toolset image block - I do not get the custom fields. All I see is "Author Picture URL".

Two questions:

1. How might I access the ACF field to display the image in the loop?

2. Does Toolset offer a similar function, where my end-user can crop their image to specific dimensions when they upload the file? If so then I could just use Toolset alone and not worry about ACF. The image crop is the only reason I'm not using a Toolset field group.

Thank you for your help.

#2140539

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

We are aware of the issue where the image dynamic source doesn't show the custom fields.
1. How might I access the ACF field to display the image in the loop?
What you can do is to use the single field block to display the images however you won't have the options that would normally appear on the image blocks to customize the image display.

2. Does Toolset offer a similar function, where my end-user can crop their image to specific dimensions when they upload the file? If so then I could just use Toolset alone and not worry about ACF. The image crop is the only reason I'm not using a Toolset field group.

No the image will need to be modified before it is uploaded to the website.

Thanks,
Shane

#2142573

Shane, thank you.

I ended up going about this a different way. Rather than use Gutenberg blocks in the Archive loop, I instead inserted a Content Template built with the Classic Editor. I then created the content template the old fashioned way, using an ACF shortcode. I've got the result I need on the frontend and also can continue to use the image-crop field from ACF which is better for the client in the backend.

I try to use Gutenberg as much as possible, and also try not to mix ACF and Toolset if I don't have to. Whenever possible I use Toolset custom fields when working with my custom post types. But this was an instance where it made the most sense to go ahead and do those things.

Thanks for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.