Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all,
I would like to update .liquid files throught the Admin REST API, but I keep getting an 422 Unprocessable Entity error.
To be more precise, the error I get is:
"body": { "errors": { "asset": [ "Missing {{content_for_header}} in the head section of the template", "Missing {{content_for_layout}} in the body section of the template" ] } }
This would make sense, if I would actually be missing this in my template. But it's right there. See below the code I would like to update:
{ "asset": { "key": "layout/theme1.liquid", "value": "<html>\r\n<head>\r\n{{content_for_header}}\r\n<title>{{ shop.name }} - {{ page_title }}</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\r\n{{ \"screen.css\" | asset_url | stylesheet_tag }}\r\n</head>\r\n<body>\r\n{{content_for_layout}}\r\n</body>\r\n</html>" } }
I've tried everything, but I don't see what's wrong. Any ideas on what this could cause this?
On top of that; I can save the file manually in the UI without issues.
Thank you
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024