Panel - Displaying the number of characters of each page

Hi, I wonder if there is a way to display for each page in the panel the number of chars of the page (one or more fields considered). Expecially when using the blocks field.


That’s certainly possible, but the question is what exactly you want to count.

Most of the times, the content of a specific field.

For a blocks field, you can probably do something like this:

$blocks = $page->text()->toBlocks()->toHtml();

For other fields, there is a field method called length()


If you call that on a blocks field, it probably counts every character stired in that field, which wouldn’t make sense. But also for textarea, it would count Kirbytags, HTML if present etc.

Thank you @pixelijn but what I don’t know is how to expose inside the panel the value. I need the author of the post to be aware of how long his article is.

In real time? Like, while he’s typing?

After the page is saved