I had a chance to start playing with new themes, and I noticed that data-media-id attributes, which were previously present in all Shopify themes, are missing on the slides. This attribute is very helpful when we need to programmatically manipulate images (hide/show), and many apps rely on these parameters. With the current code, we will need to process file names, which won’t be good for performance, and more error-prone media IDs would be super helpful with all media elements on the page.
Hi Farid,
Thanks for raising this and describing how you’ve been relying on the data-media-id attributes. I’m connecting with internal folks to surface feedback and to get their recommendations.
1 Like
Hey Farid, as discussed in DM’s we’ve added this to the large media and will add it to thumbnails and zoomed images soon too.
It’s worth noting that while we will add this back, it’s not an officially supported API and might break in the future in Horizon or in future themes. (let us know if it does) We’ll think through how we could best support your use case in the future.
1 Like
Thanks a lot, Max, this is super helpful for the performance of our app and similar apps that work with media.
Thanks for raising this internally Liam
1 Like