Display a how long it will take the average user to read your content. The value can be provided in the form of a string, array, matrix field or whole entry.

Examples

String

{% set value = 'Mizzen run a shot across the bow fore lateen sail pink Sea Legs provost loot marooned mizzenmast.' %}
or
{% set value = entry.plainTextField %}

{{  value|readTime  }}

Returns: 5 seconds

Array

{% set array = [
    'Mizzen run a shot across the bow fore lateen sail pink Sea Legs provost loot marooned mizzenmast.',
    'Shiver me timbers carouser grog hulk wench weigh anchor Sail ho Chain Shot wherry booty.'
] %}

{{  array|readTime  }}

Returns: 9 seconds

Matrix Field

{% set matrix = entry.matrixField.all() %}

{{  readTime(matrix)  }}

Returns: 1 minute, 58 seconds

Whole Entry

{{  readTime(entry)  }}

Returns: 4 minutes, 25 seconds

Disabling Seconds

Seconds are included by default, but can be disabled like so:

{{ value|readTime(false) }}

or

{{ readTime(entry, false) }}
Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
1,008
Version
2.0.0-beta.1
License
MIT
Compatibility
Craft 3, Craft 4
Last release
March 8, 2023
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs