Truncate transcluded list body?

Hi, here’s the code I’m using for a transcluded list:

<$list filter="[tag[HelloThere]!sort[created]limit[3]]" join="<hr>">
!!!<<currentTiddler>>
<$transclude mode=block/>
</$list>

What I’d like to do is truncate the body of the tiddlers displayed. Kinda like the body of blog posts on a blog’s main page, where you have to click “read more” to see the rest of the post. I want viewers to have to click the tiddler title link to see the rest of the tiddler, but have the body of it truncated within the list. Is this possible? Thank you.

The easiest way to show truncated transcluded content is to wrap the rendered content within an html DIV container that has a maximum height (e.g., 10em) and hides anything that exceeds that height, like this:

<$list filter="[tag[HelloThere]!sort[created]limit[3]]" join="<hr>">

!!!<$link/>
<div style="max-height:10em;overflow:hidden;"><$transclude mode=block/></div>
</$list>

Notes:

  • A blank line is required before the !!!<$link/> syntax so that the !!! heading format will be properly rendered. Alternatively, you could use HTML <h3><$link/></h3> which would allow you to omit the blank line.
  • You should use the <$link/> widget, rather than <<currentTiddler>>. This ensures that the title is always shown as a link even if it is not a WikiWord or if the title contains embedded spaces. Note that <$link/> uses the “short-form” of the $link widget, which defaults to rendering the currentTiddler value for the link text as well as the link destination.

enjoy,
-e