Article table of contents

Add a table of contents to your blog articles to improve navigation and readability.


Create metafield definition

  1. Navigate to Settings > Custom Data > Blog Posts

  2. Click Add Definition

  3. In the Name field, type Table of contents

  4. Ensure the Namespace and Key field is set to custom.table_of_contents

  5. Click Select Type and choose Single line text

  6. Select List of values

  7. Click Save

Update metafield values

  1. Navigate to the blog post you'd like to update

  2. Scroll to the bottom and click Show all next to metafields

  3. Enter values for each heading you want to appear in your table of contents

Add block

  1. In the Shopify Theme Editor, navigate to the Blog Post Template

  2. Click Add Block under Article Main

  3. Search and select Table of Contents


Update headings

  1. In Shopify, navigate to the blog post you'd like to update

  2. Click the Show HTML icon on your blog content

  3. Add id="HEADING-NAME" to your heading tags. The id attribute should match the table of contents

    • Example: <h1 id="your-heading-text">Your Heading Text</h1>.

  4. Hit Save

\

Last updated

Was this helpful?