Log1x / sage-directives

A set of Blade directives for use with Roots Sage.
https://log1x.github.io/sage-directives-docs/
MIT License
284 stars 35 forks source link

@image directive with ACF field on archive partial not working #135

Closed kevinlisota closed 8 months ago

kevinlisota commented 1 year ago

I have a new installation of Sage 10 and Sage directives, so everything is current. ACF image field name is my_photo and returns the image ID.

On my `content-single-CPT`` partial, I have the following code:

@hasfield('my_photo')
  @image('my_photo', 'medium_large', ['class' => 'h-auto max-w-full rounded-3xl shadow-2xl'])
@endfield

On my content-CPT archive partial, I have the following code:

@hasfield('my_photo')
@field('my_photo')
@image('my_photo')
@endfield

On the archive partial, the @field directive correctly returns the image ID from the ACF field. However, the @image directive does not output the image HTML.

I'm a bit stumped. In both cases, the call is made "in the loop." Any pointers?

Log1x commented 1 year ago

Assuming you're on the latest version, @image in particular is a little busted right now. https://github.com/Log1x/sage-directives/issues/117

There's a PR open at https://github.com/Log1x/sage-directives/pull/118 but I think it will need something a little different than what is proposed at the moment. I will try to look into it soon.