Reading time

Reading time for Blog app

Adds an article reading time indicator

5.0 1 rating

Your review
Installs
10+
Developer
The plugin adds information about the time the article was read.

Despite the fact that the plugin is compatible with the old version of PHP 7.2, we recommend using it on systems with PHP 7.4, 8.0 for faster and more stable work.

The plugin allows you to extend the standard features of the Blog application. The plugin allows you to display the reading time of the article in the article list and on the article view page.

Features of operation and settings

The plugin analyzes the size of the article and calculates the time it will take to read the article. Based on timing lies the "Reading speed" parameter, which you specify on the plugin settings page. Images are also taken into account in the time calculation ("Time to image").


After installation, if you already have blog articles, a new "readtime" field will appear in the database for those articles, which will default to "1".
In order for the script to analyze the time for reading the article and update the information in the database, you need to open the article editing and click the save button.

Output by plugin methods

The plugin provides automatic output for the standard theme and themes based on it. To do this, in the plugin settings -> "Place to display" -> select "plugin methods". In case of incorrect work, use independent output in the template.

Independent use in a template

To display the reading time on the main page of the blog (where all articles are presented in the feed) and on the article view page, you must place code(see below) in templates:

  1. In the post list template (stream_posts.html or stream.html), place the code inside tags
    {foreach $posts as $post}...{/foreach}
  2. To the single post output template(post.html), in the place where you want to see the time indicator.

Code for templates

{if !empty($post.readtime)}
Reading time: {$post.readtime}
{/if}

Do you have any questions? Write to us ›

welldi.ru

All products of this developer