Gossamer Forum
Home : Products : Gossamer Links : Discussions :

URL Display Problem

Quote Reply
URL Display Problem
How would I setup a global to limit the number of characters in a URL. I like displaying the URL under the link description but long URL’s break apart my templates. Since the URL is only a display and not ckickable, limiting the length seems to be the answer.
Something like-
http://www.longname.com/111/yef/todaysnewsstories/111…

Quote Reply
Re: [jgkiefer] URL Display Problem In reply to
Don't quote me but....
Code:
sub {
my $tags = shift;

my $url = $tags->{URL};
$url =~ s,^(.{50}).*$,$1...,;

return $url;

}

Last edited by:

RedRum: Nov 12, 2001, 7:07 PM
Quote Reply
Re: [RedRum] URL Display Problem In reply to
Thanks RedRum,
I'll give it a try.
Quote Reply
Re: [RedRum] URL Display Problem In reply to
Just the ticket, works great!
Wink
Quote Reply
Re: [jgkiefer] URL Display Problem In reply to
Cool!

Last edited by:

RedRum: Nov 12, 2001, 7:24 PM