ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Get Bard content reading_time

Open jimblue opened this issue 4 years ago • 5 comments

In Statamic 2 I was doing:

{{ bard_field | flatten | join | strip_tags | read_time }}

But in Statamic 3 the data structure has change and it's not working anymore.

Also I've read in the doc that Bard have an option to show estimated reading time at the bottom of the field. It is very nice and it could nice to have access to this data in the frontend with Antlers.

jimblue avatar Jan 30 '20 23:01 jimblue

Ah yeah that new calculation is only in the fieldtype's JavaScript. We can look at adding support for Bard fields in the read_time modifier so you won't have to do your own markup wangjangling. Might be a little while tho.

jackmcdade avatar Jan 31 '20 15:01 jackmcdade

haha indeed! thank you Jack :)

jimblue avatar Jan 31 '20 22:01 jimblue

would need that in the content API too :)

would be great to get that when fetching blog posts for an blog overview page

goellner avatar Nov 23 '20 16:11 goellner

would need that in the content API too :)

indeed great idea @goellner

jimblue avatar Dec 01 '20 22:12 jimblue

FYI this is now a bit easier with the bard_text modifier:

{{ content | raw | bard_text | read_time }}

jacksleight avatar Sep 29 '22 11:09 jacksleight