Adding custom HTML and inline javascript into Dawn Theme custom liquid section

AI-generated summary

Upgrading a Shopify site to the Dawn theme raised an issue with embedding custom code. Previously, a “custom HTML” section accepted HTML plus inline JavaScript (e.g., to randomize how content loads).

  • In the Dawn theme’s “custom Liquid” section, pasting the same code triggers an editor error: “This code has errors. Correct the syntax to save your custom Liquid.”
  • The author asks whether JavaScript requires specific tags or a different approach within the custom Liquid section to be accepted.

Key details:

  • Goal: Preserve existing dynamic behaviors achieved with inline JavaScript on custom pages.
  • Blocker: Liquid section validation rejects the submitted code; exact code not provided.

Status and next steps:

  • No confirmed solution or guidance yet from others in the thread.
  • Open question remains on how (or if) inline JavaScript should be included within the Dawn theme’s custom Liquid section.

HI all,

I’m looking at upgrading my shopify site using the dawn theme.
My current site has a lot of custom pages that use the custom html section. Allowing me to add custom html and javascript to do stuff like randomise how the content loads on the page.

But when i try to add the code to the custom liquid section, i get this:
‘This code has errors. Correct the syntax to save your custom Liquid.’

Do i need to place any tags around the javascript?

2 Likes