spatie / statamic-responsive-images

Responsive images for Statamic 3
MIT License
99 stars 29 forks source link

Field doesn't work with blade #141

Closed stuartcusackie closed 2 years ago

stuartcusackie commented 2 years ago

This has been mentioned here - Though that issue is closed and refers to Globals. This is a problem with all responsive fields in Statamic 3.3:

@responsive($set->image)

Array to string conversion

 array:2 [▼
  "src" => Statamic\Fields\Value {#3111 ▶}
  "lg:src" => Statamic\Fields\Value {#5012 ▶}
]

Temporary solution (you would have to do this with every breakpoint available on the field, and if you're allowing ratios / fit on the field then it would get really complicated!):

@responsive($set->image['src'], ['lg:src' => $set->image['lg:src'] ?? null])