Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

James MacAulay commented on API images no longer saving ALT tags?

$
0
0

You can set an alt tag for your image by creating a metafield on the image with a namespace of "tags" and a key of "alt":

{  "product": {    "title": "Basket of Kittens",    "product_type": "Basket",    "product_vendor": "Kittens Inc.",    "images": [      {        "position": 1,        "src": "http://cdn.shopify.com/s/files/1/0572/9965/products/Basket-of-kittens.jpg?v=1405024216",        "metafields": [          {            "namespace": "tags",            "key": "alt",            "value": "basket of kittens",            "value_type": "string"          }        ]      }    ]  }
}

The fact that the same thing could previously be accomplished by setting an "alt" property on the image directly was undocumented and so it went by unnoticed when we recently tightened up our code to be more strict about allowed inputs. We may re-add the "alt" property to the API in the future as a documented feature, but for now you should use the above metafield.


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>