Closed Saboteur777 closed 2 years ago
Most Wordsmith functions, including readTime
, operate on a string
input. If you pass in an Entry
or MatrixBlockQuery
object instead of a string, PHP will try to cast the object as a string (using its __toString()
method, if there is one). That probably won't be very useful. (IIRC, the _toString()
of an entry just returns its title
.) To estimate the total read-time of an entry, you need to first get the total text content, by rendering the fields into meaningful string values.
I am trying to use the readTime filter with matrix fields, but I can't make it work, as
entry | readTime(rate=140, minimum=2)
return 2 every time (sure, because withoutminimum
it would return 1). I have also triedentry.matrixField
, but it did not work either.