Developer blocks
The Custom liquid block and section for raw Liquid, HTML, CSS, and JS, and the Page content block for rendering a page resource's stored HTML.
Use "Custom liquid" when a theme setting or block can't produce the markup you need. The block adds Liquid inside another section. The section adds Liquid at section level. "Page content" renders the stored HTML from a Shopify page.
Custom liquid or Page content
Custom liquid renders the input without escaping or sanitizing it. Liquid runs at render time, including {{ shop.name }}, {{ product }}, loops, and conditionals. "Output" either adds a wrapper <div> or renders the input with no wrapper.
Page content doesn't accept code. It selects a Shopify page and renders the page's body HTML with theme typography.
The Custom liquid block
Add the block inside a Custom section or any other section that accepts blocks. It has three settings.
Output
Wrapped (default)
Your code inside <div class="w-full entrance-item entrance-standard">
Visible content that animates in with the section and stays selectable in the editor
Raw
Your code and nothing else
<style>, <script>, <link>, @font-face, JSON-LD, or anything else that can't have a wrapper <div>
Prevent dynamic updates
Cart and product form changes can re-render a section. This repeats side effects in Custom liquid, such as a <script> that mounts a widget. Turn on "Prevent dynamic updates" to add data-morph-update="none" to the wrapper. Section updates will then leave the block alone.
Turn it on when your block runs one-time initialization or holds state that a re-render would reset. The setting only appears in Wrapped output, because Raw output has no element to mark.
The Custom liquid section
The Custom liquid section has the same settings, plus the standard "Section layout" and "Appearance" groups for width, padding, and color scheme. Use the section for a complete page section. Use the block between other blocks.
Two behaviours differ from the block:
In Raw output the code also skips the theme's section wrapper, so it lands unwrapped in the page flow.
The section is disabled in the header and in the overlay and drawer groups.
Recipe: self-hosted font
Use the theme's typography settings and Shopify font library when possible. Use this setup for a font that isn't in the library.
Add a Custom liquid block in a footer section, set "Output" to "Raw", and paste:
Footer placement keeps the code out of the initial page content. @font-face and :root custom properties still apply to the whole document.
The Page content block
The block renders a selected page's page.content inside a prose wrapper, so tables and rich text use the theme's typography. Use it for HTML written in the page editor or added by an app, such as a shipping table or size chart. Liquid inside page.content doesn't run.
"Page"
The page resource whose body HTML renders
"Text size"
The prose scale, from xs to xl
"Limit width" and "Max width"
Constrain the text measure
"Color"
Optional text color override, scheme color or custom
When no page is selected the block renders an empty wrapper, so it stays selectable in the editor.
See also
Custom code:
custom.cssand JavaScript files for site-wide codeTheme events: events available to Custom liquid scripts
The Custom section: the usual host for these blocks
Layout blocks: structural blocks to use before Custom liquid
Global settings & local overrides: CSS variables controlled by settings
Last updated
Was this helpful?

