Blog Time to Read adds a basic time to read calculation for your awesome posts. This is an extension for RainLab Blog plugin.
If you like the plugin, please rate it and leave a review if you have something to say.
Please also check other nice plugins:
The following plugins are required
Blog
A robust blogging platform.
Blog
A robust blogging platform.
Translate
Enables multi-lingual websites and translate website contents.
Translate
Enables multi-lingual websites and translate website contents.
Blog Time to Read adds a basic time to read calculation for your awesome posts.
Requirements
The Blog Time to Read plugin requires RainLab Blog and RainLab Translate.
Settings
Plugin defaults are controlled via backend settings panel, just look for Blog Time to Read in your Settings dashboard. Currently you can set default reading speed (words per minute, the initial value is 300 wpm) and result rounding to the closest higher integer (it is enabled by default).
Implementing Frontend Pages
The Blog Time to Read plugin provides several ways to get time to read for your blog post:
-
The default
Post
model is extended withtimeToRead
property which gives you a number in minutes to read the post. The default settings are being used for calculation.{{ post.timeToRead }}
-
Templates can use a new Twig
timeToRead
filter which uses the initial settings by default but also allows to override them explicitly (the example shows how you can set 100 wpm speed without rounding for a filter).{{ post.content | timetToRead(100, false) }}
-
TimeToRead component is available for use.
Component properties:
- Post slug - get time to read for the post specified by the slug value from URL parameter;
- Default reading speed - words per minute by default;
- Rounding up - round fractional values to the next highest integer value.
Please note that default component partial contains the call to translation filter.
<div> <p>{{ ":count min to read" |_({ count: __SELF__.minutes }) }}</p> </div>It allows you to edit the message using the Translate plugin and specify messages for different languages too.
-
Ompmega
Found the plugin useful on 6 Sep, 2019
Perfect!
-
1.2.1 |
Move settings into blog category Sep 06, 2019 |
---|---|
1.2.0 |
Minor README changes; another style to list required plugins Jan 09, 2019 |
1.1.0 |
Degraded from PHP7.1 to PHP7.0 to support the minimal required version for October CMS. Nov 27, 2018 |
1.0.1 |
Fixed typo in README Nov 27, 2018 |
1.0.0 |
The initial release of Blog Time to Read Aug 23, 2018 |