Skip to content

kevinsguides/auto-scrollspy

Repository files navigation

Auto Scroll Spy

A Joomla 4/5 Extension

This extension will allow you to generate a table of contents with scrollspy for your articles automatically. I know the acronym is A.S.S. That wasn't intentional but I'm too lazy to change it. screenshot 2

How it works

  1. Enable plugin and module
  2. Assign module to position you like, ideally in a sidebar
  3. Read through plugin settings - all the settings are in the plugin! Not the module
  4. Plugin scans for headings at the levels you defined in all articles
  5. Module/plugin displays the formatted page menu
  • Feature/specs
    • Up to two levels of headings can be used, for example, it can add every h2 and h3 element to the list, or h3 and h4, and so on...
    • It can auto generate the first item based on page title
    • Bookmark/anchors are automatically generated
    • Scrollspy can be turned on or off, so you can use it just for a table of contents if you want
    • A few different display and color options (default template, dark, and light)
    • Can be published to a module position, or you can display in a floating panel on side of page
    • You can specify minimum # of items to count before making the list, so you don't show a table of contents on short articles

For best results

  • Use consistent heading structure
  • Don't use weird symbols or icons in headings
  • Use on a template that includes bootstrap (should be most templates)
  • Prefer module to the floating panel thing
  • Avoid using on articles with over 10 or so headings, at that point you should probably turn your article into separate pages

screenshot 1 screenshot 3