メタフィールドのファイル(画像)の「代替テキスト」で設定したテキストを表示させたいです。

メタフィールドのファイル(画像)の「代替テキスト」で設定したテキストをimgのaltではなく別のところに出す方法を教えていただけますでしょうか?

例えばimageというメタフィールドを作って以下Pタグ内に「代替テキスト」を表示させたいです。

ここに「代替テキスト」のテキストデータを表示

フィルターなどを探しましたがやり方がわからなかったのでご教授いただけると幸いです。

:waving_hand: Hey @Anonymous_08c5a3679bd76251614e6c783b120416 ,

This is Matt from the Metafields team.

You can access the reference object of the metafield by appending .value to the metafield. Once you’ve done that, you can access the alt text directly via .alt.

In your case, it would look something like this.


{{product.metafields.my_fields.image.value.alt}}

Hope that helps!

1 Like

実装できました!

ありがとうございます。