Read Progress Bar
Reading progress bar for post pages in Contensio
About this plugin
Read Progress Bar
Displays a thin progress bar fixed at the top of the page that fills as the visitor scrolls through a post. The bar tracks progress against the post body specifically, so it reaches 100% when the end of the article is in view - not the bottom of the page.
Features:
- 3 px fixed bar at the top of the viewport
- Activates only on post pages (requires
.contensio-post-bodyclass on the content wrapper) - Passive scroll listener - zero impact on scroll performance
- No database queries, no admin configuration
- Ember-coloured (
#e05b2b) to match the Contensio admin brand
Requirements
- Contensio 2.0 or later
- The active theme must apply the
contensio-post-bodyclass to the post content wrapper (the default theme does this automatically)
Installation
Composer
composer require contensio/plugin-read-progress
Manual
Copy the plugin directory and register the service provider via the admin plugin manager.
No migrations or configuration required.
How it works
The plugin hooks into contensio/frontend/head and injects a small <div> element and an inline <script> block. The script:
- Finds the element with
id="contensio-progress"(the bar) - Finds the post body wrapper via
.contensio-post-body - If either is missing, it exits immediately - no effect on non-post pages
- Attaches a passive
scrolllistener that calculates(-rect.top / (postHeight - viewportHeight)) × 100and sets the bar width
The CSS positions the bar with position: fixed; top: 0; left: 0; z-index: 9999 so it floats above all page content.
Hook reference
| Hook | Description |
|---|---|
contensio/frontend/head |
Injects the progress bar element and scroll script |