We have custom code on our Shopify Dawn theme website that allows us to embed a product or a blog post in another blog. This gives the reader of the blog a better experience as they can easily add the relevant products to their basket or click on a relevant blog to read more about that subject. Our developers chose to build this feature for the embedded products by using their product ID. However, for the embedded blog posts they linked it to the H1. Being linked to the H1 creates the following problem: when a blog post has been revamped and the H1 changed, the embed no longer works. Besides the H1 changes based on language, as our website is multilingual. Therefore I would like to change the unstable H1 value to the blog post ID that always remains unaltered and works in every language.
I tried to find an answer online:
I tried finding information about this subject, but I haven't really found an answer to what I'm looking for. I'm also not a pro and don't really know what I'm looking for.
Does anyone know how I can relatively easily change the variable in the code to swap the H1 out for the blog post ID? How do I have to change this? How do I change my metafields to correctly work with the code?