Custom Liquid and HTML
When you need code that no built-in setting covers, Reign gives you two ways to drop it onto a page: the Custom Liquid section and the Custom Liquid block. Both take Liquid, HTML, or an app snippet and render it in place. The difference is where the code sits and what it can read.
Use the section for a standalone band of custom code, with its own width, spacing, and background. Use the block to place custom code inside another section, next to that section's content.
Custom Liquid section
A full-width section that renders whatever you type into one field. Add it from Add section under the Layout group.
- In the theme editor, open the page where you want the code.
- Click Add section.
- Under Layout, choose Custom Liquid.
- Open the section and paste your code into the Liquid field.
You cannot add this section to the header, the footer, or an overlay group. For those areas, use the Custom Liquid block inside a section that already lives there.
Settings
- Liquid: the field that holds your code. Liquid, HTML, and app snippets all render here.
The section runs at the page level, so it cannot read a product or collection on its own. To read the current resource, use the block instead (see below).
This section also uses the standard Color, Layout, Size, Appearance, Border, Padding, Margin, and Visibility controls. See Common section settings.
Custom Liquid block
A block you add inside a section, alongside that section's other blocks. It appears in Add block under the Basic group.
- In the editor, select the section you want the code in.
- Click Add block.
- Under Basic, choose Custom Liquid.
- Drag it to the right spot in the section's blocks, then paste your code into the Liquid field.
Settings
- Liquid: the field that holds your code. Liquid, HTML, and app snippets all render here.
The block runs inside its host section, so it can read the page's resource. On a product page it can reach the current product, and on a collection page the current collection, which lets you output values tied to what the shopper is viewing. The section version cannot do this.
Which one to use
- Reach for the section when the code is its own band of the page and you want background, width, and spacing controls around it.
- Reach for the block when the code belongs next to existing content, or when it needs to read the current product or collection.
Tips
- The Liquid field renders code, so a typo can break the page or the editor preview. Keep a copy of what you paste so you can revert.
- To add vertical space rather than code, you do not need a Custom Liquid section. Add the Spacing section (also under Layout), whose main control is Height. For spacing between blocks inside a section, see Common section settings.