Davyc Posted February 5, 2022 Posted February 5, 2022 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? SeNioR- and OptimusBain 2
Sonya* Posted February 5, 2022 Posted February 5, 2022 Create a custom field, estimate the time and fill the field. Show it on above content?
Nathan Explosion Posted February 5, 2022 Posted February 5, 2022 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 SeNioR-, Sonya*, Martin A. and 2 others 3 2
Sonya* Posted February 5, 2022 Posted February 5, 2022 (edited) 1 hour ago, Nathan Explosion said: Edit the database template Displate -> Record No need to edit template. Custom field would do the same 😉 Pay attention to Default Value! It has to be filled out in order of the field to be displayed. Edited February 5, 2022 by Sonya* Afrodude, Martin A., SeNioR- and 2 others 4 1
Davyc Posted February 5, 2022 Author Posted February 5, 2022 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.
Daniel F Posted February 5, 2022 Posted February 5, 2022 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 🔥🔥🔥😂 SeNioR- 1
Sonya* Posted February 5, 2022 Posted February 5, 2022 11 minutes ago, Daniel F said: Who’s going to create TDBF 1
TDBF Posted February 6, 2022 Posted February 6, 2022 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. Sonya* and Davyc 2
Davyc Posted February 6, 2022 Author Posted February 6, 2022 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. 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.
Nathan Explosion Posted February 6, 2022 Posted February 6, 2022 (edited) 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)} (NE) get__readtime() 1.0.0.xml Edited February 6, 2022 by Nathan Explosion Davyc, Randy Calvert and SeNioR- 2 1
Ocean West Posted February 6, 2022 Posted February 6, 2022 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.
Daniel F Posted February 6, 2022 Posted February 6, 2022 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
Ocean West Posted February 7, 2022 Posted February 7, 2022 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.
Recommended Posts