Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: Re: [Payooo] Short description ... read more: Edit Log

Here is the list of edits for this post
Re: [Payooo] Short description ... read more
Give this one a go :)

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!

Last edited by:

Andy: Oct 8, 2004, 7:17 AM

Edit Log: