Adding a table of contents sticky section

Topic summary

A user is attempting to implement a sticky table of contents sidebar that appears on every page of their store, including the homepage. They’ve been working on this for a week without success and recognize they need to create a custom section and modify the theme.liquid file to display the sidebar on each page.

Another participant confirms that custom code is required to achieve the sticky sidebar functionality. The implementation remains unresolved, with the original poster requesting code snippets or guidance to complete the feature.

Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

I’m wondering if anyone has had experience adding a custom table of contents that is sticky to the side of the page (almost like a sidebar menu). I want to be able to add this on EVERY page (including home)

I’ve been working on it all week with no luck. I know I need to add a new custom section and also need to reformat the theme.liquid page to be able to view the sticky sidebar table of contents for each page.

Any help or code snippets would be greatly appreciated! Thank you!

This site is a good example of what I want to add:
https://www.garagegymreviews.com/best-pre-workout

@mad-coder yeah to stick the sidebar you have to do custom code regarding of it .