I am using the trunchtml plugin which does a great job in preventing my template from breaking. I am however having issues with it not outputting the …
Here is the code I am using:
{exp:trunchtml chars="200" ending="<a href='{comment_url_title_auto_path}'>continue reading</a>" inline="..."}
{summary}
{/exp:trunchtml}
Am I missing something?
Moderator’s note: Moved to the Plugin subforums.
Like you, I like this plugin, but find it lacking the elipsis.
It can be fixed with a little hack.
in pi.trunchtml find:
if ($exact != "yes") {
$spacepos = strrpos($truncate, ' ');
if ( $spacepos !== FALSE ) {
$truncate = substr($truncate, 0, $spacepos);
}
}
foreach ($open_tags as $tag) {
$truncate .= '</' . $tag . '>';
}
$truncate .= " " . $ending;
$this->return_data = $truncate;
and change to:
if ($exact != "yes") {
$spacepos = strrpos($truncate, ' ');
if ( $spacepos !== FALSE ) {
$truncate = substr($truncate, 0, $spacepos);
}
}
// add "..." at the end
$truncate .= "...";
foreach ($open_tags as $tag) {
$truncate .= '</' . $tag . '>';
}
$truncate .= " " . $ending;
$this->return_data = $truncate;
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.