Brickspace Lab
Contact usContact ShopifyTry a theme
Space
Space
  • Space documentation
  • Getting started
    • Theme basics
    • Theme settings
      • Theme typography
      • Selecting theme colors
  • Guides
    • Products
      • Adding product subtitles
      • Adding product badges
      • Replacing "Add to cart" for a product
      • Disable "quick add" for a product
      • Product template
    • Collections
      • Collection template
    • Sitewide
      • Using color and option swatches
      • Using device specific visibility
      • Dynamic discount popups
      • Blog template
      • Article template
      • Search results
  • Sections
    • Sitewide
      • Header
      • Footer
      • Announcement
      • Cart drawer
    • Navigation
      • Menu drawer
      • Fixed menu
      • Search drawer
      • Navigation slider
    • Content and Media
      • Video
      • Slideshow
      • Marquee
      • Split banner
      • Image hotspot
      • Countdown
      • Discount
      • Logo list
      • Banner
      • Slider
      • Testimonial slider
      • Search banner
      • Rich text
      • Blog posts grid
      • Testimonial grid
      • Icon grid
      • Collapsible content
      • Tabs
      • Text highlight
      • Block reveal
      • Tooltip
      • Collage
      • Comparison table
    • Products and collections
      • Featured product
      • Alt collection grid
      • Collection list grid
      • Collection list slider
      • Collection slider
      • Featured collection grid
      • Product list
      • Recently viewed
    • Forms
      • Static chat
      • Email sign-up
      • Contact form
      • Custom liquid
      • Store locater
  • General
    • Changelog
      • v2.1.1
      • v2.1.0
      • v2.0.0
      • v1.2.1
      • v1.2.0
      • v1.1.0
      • v1.0.1
      • v1.0.0
    • Known issues and troubleshooting
      • v2.0.0
    • Cloning a demo theme
Powered by GitBook
LogoLogo

Try a theme

  • Paper
  • Space
  • Keystone

Resources

  • Get theme support
  • Services
  • Contact
On this page
  • Space: Using the article template
  • Summary
  • Showing a table of contents
  • Create metafield definition
  • Update metafield values
  • Add block
  • Update headings

Was this helpful?

Edit on GitHub
  1. Guides
  2. Sitewide

Article template

Space: Using the article template

Summary


The article template showcases the content of a blog post.

Showing a table of contents


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 custom.table_of_contents

  5. Click Select type and select "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 in 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

    1. The id attribute should match the table of contents

    2. For example, you click a table of contents link you'll notice the URL bar is updated - this will give you the value that is needed for your id attribute

    3. The heading tags should now look like this

      <h1 id="your-heading-text">Your Heading Text</h1>

Last updated 1 month ago

Was this helpful?