Forum

Thread tagged as: Question, Blog

Using chars on perch:blog tag

Hi

I'm putting together a template to show the latest blog posts on the home page, straight forward itself.

However, I want to limit the number of characters for the excerpt content by using chars="156" append="..." but when I do, I get this error...

Warning: strlen() expects parameter 1 to be string, array given in /home/timberpaint/S0UDI3YO/dev/cms/core/lib/PerchTemplate.class.php on line 348

...all the excerpt content displays and isn't chopped off after 156 characters.

Many thanks

Glen Piggott

Glen Piggott 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us the tag?

<perch:blog id="excerpt" chars="156" append="..." />
Drew McLellan

Drew McLellan 2638 points
Perch Support

You're missing the type attribute.

I've just seen the error of my ways so have updated it and it's now working...

<perch:blog id="excerpt" type="textarea" chars="156" append="..." />