Give this one a go :)
my $id = $_[0];
my $desc = $_[1];
my $chars = $_[2] || '300';
my $build_url = $CFG->{build_root_url};
if (!$desc) { return "No description on this template"; }
length $desc < $chars and return $desc;
my $short = substr ($desc, 0, $chars);
$short =~ s/\s\S+?$//;
$short .= "<b> ... read more</b>";
return $short;
my $detailed_url = "$build_url/Detailed/$id.html";
$short .= qq|<b> ... <a href="$detailed_url">read more</a></b>|;
}
...you can call it with;
<%global($ID,$Description,'300')%>
Basically, you need to pass in ID, Description and how many charachters you want to use :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
sub { my $id = $_[0];
my $desc = $_[1];
my $chars = $_[2] || '300';
my $build_url = $CFG->{build_root_url};
if (!$desc) { return "No description on this template"; }
length $desc < $chars and return $desc;
my $short = substr ($desc, 0, $chars);
$short =~ s/\s\S+?$//;
$short .= "<b> ... read more</b>";
return $short;
my $detailed_url = "$build_url/Detailed/$id.html";
$short .= qq|<b> ... <a href="$detailed_url">read more</a></b>|;
}
...you can call it with;
<%global($ID,$Description,'300')%>
Basically, you need to pass in ID, Description and how many charachters you want to use :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!