Conditionally output "Read more" depending on word count
Is it possible to conditionally output something based on the word count of the field?
For example, on a "list" page I am outputting a truncated bio of a profile like this:
<perch:content id="biography" words="42" append=" …"/>
This is fine, but I would like to add a "read more" link only if the word count is over the limit of 42. For instance, like this:
<perch:content id="biography" words="42" append=" <a href="/some-page/<perch:content id="slug" type="slug" />">View Full Profile</a>"/>
Obviously the above does not work because it's outputting as a string, but it demos what I would like to happen.
Is something like this possible?