Closed eqtrd closed 1 year ago
Hi @eqtrd Are you sure ? Both should work with this : https://github.com/tristantbg/kirby-shopify/blob/master/index.php#L47
<img src="<?= $page->shopifyImages()->toStructure()->first()->img_url('1000x1000') ?>
doesn't return anything for me (empty image src) while :
<img src="<?= $page->shopifyImages()->toStructure()->first()->src()->img_url('1000x1000')?>" alt="">
returns the good url.
I guess $field in https://github.com/tristantbg/kirby-shopify/blob/master/index.php#L47 should be a fieldObject. and var_dump($page->shopifyImages()->toStructure()) returns a StructureObject.
Indeed... you are right !
Merci ;)
Hi Tristan !
It seems there is an error in your README.md.
Resizing images with
<img src="<?= $page->shopifyImages()->toStructure()->first()->img_url('1000x1000') ?>"
may not work.it should probably be :
<img src="<?= $page->shopifyImages()->toStructure()->first()->src()->img_url('1000x1000')?>" alt="">
img_url method requires a field object.
Thank you