Jump to content

Featured Replies

Posted

As we are used to such a busy lifestyle time is a precious commodity.  It would be useful, for Pages content, to have an estimated reading time for each article.  I know this has been done on another platform, but as to the criteria for estimating the time taken to read is something that would need to be calibrated.  Having an estimated time of reading may have a positive impact on whether someone will read an article or skip it if it 'appears' too long.  Thoughts?

Create a custom field, estimate the time and fill the field. Show it on above content?

Edit the database template Displate -> Record

Add this anywhere (change the 200 to what you believe the 'words per minute' speed is for someone reading):

{{$wordCount = \str_word_count(\strip_tags($record->_content));}}
{{$estimateTime = \ceil ($wordCount/200);}}

Then add this in your desired place in the template:

Estimated reading time: {$estimateTime} minutes

 

1 hour ago, Nathan Explosion said:

Edit the database template Displate -> Record

No need to edit template. Custom field would do the same 😉

screenshot-2022_02.05-19_28_42.thumb.png.1bd3cca2005ee1946abe52979319dc96.png

Pay attention to Default Value! It has to be filled out in order of the field to be displayed.

 

screenshot-2022_02.05-19_27_53.png.bf582edd98d56440ec2f79e94e57fc2d.png

 

Edited by Sonya*

  • Author

Brilliant responses and thank you all, this will be most helpful in encouraging people to actually put some time aside to read the published articles knowing roughly how long it will take to read. 

Simon Cowell GIF by America's Got Talent

2 hours ago, Nathan Explosion said:

Edit the database template Displate -> Record

Add this anywhere (change the 200 to what you believe the 'words per minute' speed is for someone reading):

{{$wordCount = \str_word_count(\strip_tags($record->_content));}}
{{$estimateTime = \ceil ($wordCount/200);}}

Then add this in your desired place in the template:

Estimated reading time: {$estimateTime} minutes

 

Brilliant. Who’s going to create a mini plugin hooking into IPS\Content adding a get__readtime method 🔥🔥🔥😂

11 minutes ago, Daniel F said:

Who’s going to create

hide GIF

4 hours ago, Daniel F said:

Brilliant. Who’s going to create a mini plugin hooking into IPS\Content adding a get__readtime method 🔥🔥🔥😂

I already did this Daniel.

I was going to release it to the public, however due to a hard disk failure, cloud sync error and a drunken night in where I feed large quantities of alcohol into my floppy disk bay, I lost all the code.

You know, all the normally excu... issues we developers face daily.

  • Author

Works like a charm, but I had to use the code rather than a custom field as I use @opentype Supergrid plugin and templates and had to add it to the Frontpage entry template.

image.png.af92381cfd49591aa80d9e1872ca7d33.png

The custom field method added the time to the actual article and when choosing the listing option it add the time to the top right of the image and was difficult to read depending on whether the image background matched the text colour.

The tricky aspect of using the code was to find out which template it needed to sit in, but with a bit of detective work using the browser console it was tracked down and works great.

Thanks again to everyone who contributed to the solution, very much appreciated.

Thank U Reaction GIF by BROCKHAMPTON

16 hours ago, Daniel F said:

Brilliant. Who’s going to create a mini plugin hooking into IPS\Content adding a get__readtime method 🔥🔥🔥😂

As you asked so nicely...pluralized language string included:

Example in Pages:

{$record->get__readtime($record->_content,200)}

image.thumb.png.6985ca5336337c261b4009d42c32dd02.png

 

 

(NE) get__readtime() 1.0.0.xml

Edited by Nathan Explosion

for long articles I wish there was an add-on for speed reading like this http://www.readsy.co 

Or even a button to read this article to me option that would select your content and use your computers text to speech. 

 

4 minutes ago, Ocean West said:

Or even a button to read this article to me option that would select your content and use your computers text to speech. 

No need for a plugin, that’s already possible in most OS/browsers 

23 hours ago, Daniel F said:

No need for a plugin, that’s already possible in most OS/browsers 

oh I know but you still have to manually select the text to read - some devices are easier then others. 

Recently Browsing 0

  • No registered users viewing this page.