Article Template Documentation
Summary
The article template is used to showcase the content of a blog post. It includes features like a Table of Contents to improve navigation and readability.
Showing a Table of Contents
Create Metafield Definition
Navigate to Settings > Custom Data > Blog Posts.
Click Add Definition.
In the Name field, type
Table of contents
.Ensure the Namespace and Key field is set to
custom.table_of_contents
.Click Select Type and choose Single line text.
Select List of values.
Click Save.
Update Metafield Values
Navigate to the blog post you’d like to update.
Scroll to the bottom and click Show all next to metafields.
Enter values for each heading you want to appear in your table of contents.
Add Block
In the Shopify Theme Editor, navigate to the Blog Post Template.
Click Add Block under Article Main.
Search and select Table of Contents.
Update Headings
In Shopify, navigate to the blog post you’d like to update.
Click the Show HTML icon on your blog content.
Add
id="HEADING-NAME"
to your heading tags. Theid
attribute should match the table of contents.Example:
<h1 id="your-heading-text">Your Heading Text</h1>
.
Save your changes.