Add a table of contents to your blog articles to improve navigation and readability.
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. Theidattribute should match the table of contents- Example:
<h1 id="your-heading-text">Your Heading Text</h1>.
- Example:
- Hit Save


