solved Item list display options - can comments be truncated with a "read more..." at end?

researchcooperative
@researchcooperative
6 years ago
694 posts
I am using the amazing item list display widget in Site Builder to display comments on the home page of my site.

My aim is to highlight where members are being active in this way throughout the network.

I have chosen to show just the three most recent comments, but as one commenter has posted a very long announcement, the top page is now dominated by the one comment.

Is there are an easy way to truncate comments with a "read more" at the end, when the comments are being displayed by an item list widget in Site Builder?

ps
In most cases, I expect that the original comment should be displayed in full, where it is shown in a discussion thread, for example. Nevertheless, there might also be a benefit in having a truncate/fead-more option for comments in their original locations.


--
PJ Matthews, Kyoto
Migrated from Ning 2.0. Now at Jamroom 6 beta and using Jamroom Hosting for The Research Cooperative (researchcooperative.org)

updated by @researchcooperative: 10/09/18 08:31:09PM
michael
@michael
6 years ago
7,692 posts
Yes, you can use
|truncate:200
to truncate the output to the first 200 characters. May not be a good idea if you allow HTML in your comments thought as sometimes tags can get cut-off. But if you dont then choose the amount of characters you want to show and adjust.

In Site Builder you can use a custom template (down the bottom of the form.) Find the variable you want to shorten, it may be something like
{$item.comment_text}
and add the above to it
{$item.comment_text|truncate:200}