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
712
Version
1.6.0
License
MIT
Compatibility
Craft 3
Last release
November 16, 2019
Activity (30 days)
0
Closed Issues
1
Open Issues
0
Merged PRs
1
Open PRs