ttree/eel-estimatedreadingtime

Letzte Aktivität 13 Feb 2018 4 24
composer require ttree/eel-estimatedreadingtime

EEL Helper to estimate reading time of a document

1.0.0

Version
1.0.0
Type
neos-package
Release Date
Feb 13, 2018 18:20
Source
git
Distribution
zip
Requires
MIT 94f872deac6576478b305b9f7cfb221ed78d77d1

EEL Helper to estimate reading time of a document

This package calculate a estimated reading time for the given document.

Installation

composer require ttree/eel-estimatedreadingtime

Usage

The package provide a service an EEL Helper and a Fusion prototype.

You can use the EEL Helper, if you have the content string in variable content, like this:

${EstimatedReadingTime.get(content)}

The method get accept an addtionnal parmater, the reading speed, expresed in words per minute. By default this value is 200. You can change the value in your Settings.yaml or in the expression:

${EstimatedReadingTime.get(content, 240)}

The Fusion prototype use the ContentCollection prototype provided by Neos, to render the content at the given path:

prototype(You.Site:ReadingTimeLabel) < prototype(Neos.Fusion:Value)
	readingTime = Ttree.Eel.EstimatedReadingTime:Get {
		nodePath = 'main'
	}
	value = ${'Read the article (' + this.readingTime + ' min.)'}
}

For a correct estimate, the document node must be available in the node context variable.

Acknowledgments

Development sponsored by ttree ltd - neos solution provider.

We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us.

License

Licensed under MIT, see LICENSE

The content of the readme is provided by Github
The same vendor provides 48 package(s).