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

can someone help me with a global?

Quote Reply
can someone help me with a global?
Hello,

I am trying to create a global that will allow me to limit the description where "link.html" is called. I want to limit it to 300 characters, and after it reaches the 300 character limit, if there is still more, have it say "... [read more]" and have it pointing to the Detailed page. It seems pretty simple, but I don't have a clue how to do it. Could someone please help me?

Thanks,
Adam
--------------------
Scripts - Powered by Links-SQL
Quote Reply
Re: [SkuZZy] can someone help me with a global? In reply to
http://www.gossamer-threads.com/...0description;#122980

Wink

Just edit it to something like;

Code:
sub {
my $tags = shift;
my $desc = $tags->{Description} or return "No description on this template";
length $desc < 100 and return $desc;
my $short = substr ($desc, 0, 100);
$short =~ s/\s\S+?$//;
$short .= q| ... [<a href="| . $tags->{detailed_url} . q|">more</a>]|;
return $short;
}

That should do the job (untested)

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!