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

Re: [minesite] Shorten the Title

Quote Reply
Re: [minesite] Shorten the Title In reply to
Even easier would be to pass the variable in...

Code:
sub {
my $length_l = 100;
my $value = $_[0] or return "No value...";
length $value < $length_l and return $value;

my $short = substr ($value, 0, $length_l);
$short =~ s/\s\S+?$//;
$short .= " ...";
return $short;
}


..and call with;

<%global_name($FieldName)%>

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!
Subject Author Views Date
Thread Shorten the Title sangiro 1844 Jul 2, 2004, 4:20 AM
Thread Re: [sangiro] Shorten the Title
minesite 1759 Jul 2, 2004, 5:16 AM
Post Re: [minesite] Shorten the Title
Andy 1755 Jul 2, 2004, 6:40 AM