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

Global: Capitalize (capitalise) first letter of description

Quote Reply
Global: Capitalize (capitalise) first letter of description
Hi,

Just thought I'd post this here in case it's useful to anyone else in the future.

I've just upgraded my Links installation and because my previous install had the link description follow on directly after the link title, all the descriptions had lowercase letters at the start.

My new format has the description underneath the link, and therefore needs the descriptions re-capitalising.

Rather than sit and edit thousands of links I came up with the following global to display the description with a capitalised first letter.

Global name: UpperDesc

Code:

sub {
my $vars = shift;
my $descr = $vars->{Description};
my $updescr = ucfirst($descr);
return $updescr;
}


Then in the link template, replace <%Description%> with <%UpperDesc%>

Smile
Subject Author Views Date
Thread Global: Capitalize (capitalise) first letter of description qango 2500 Feb 23, 2007, 4:05 PM
Post Re: [qango] Global: Capitalize (capitalise) first letter of description
Jonze 2422 Feb 23, 2007, 4:29 PM
Post Re: [qango] Global: Capitalize (capitalise) first letter of description
Andy 2393 Mar 9, 2007, 2:50 AM