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

Combination of two globals?

Quote Reply
Combination of two globals?
Hi I have these two globals below and I need a combination of these two.

The result of the combination should be a short description with line breaks

Global for short description
Code:
sub {
my $id = $_[0];
my $desc = $_[1];
my $chars = $_[2] || '300';
my $build_detail_url = $CFG->{build_detail_url};
my $build_extension = $CFG->{build_extension};

if (!$desc) { return "No description on this template"; }

length $desc < $chars and return $desc;
my $short = substr ($desc, 0, $chars);
$short =~ s/\s\S+?$//;

my $detailed_url = "$build_detail_url/$id$build_extension";
$short .= qq| ... <a href="$detailed_url">weiter lesen</a>|;
return $short;
}

Global for the line breaks
Code:
sub {
my $tags = shift;
my $Description = $tags->{Description};
$Description = GT::CGI::html_escape($Description);
$Description =~ s/\n/<br>\n/g;
return $Description;
}

Thanks
Matthias

Matthias
gpaed.de
Subject Author Views Date
Thread Combination of two globals? Matthias70 4076 Nov 4, 2007, 7:41 AM
Thread Re: [Matthias70] Combination of two globals?
neves 4004 Nov 5, 2007, 12:25 AM
Thread Re: [neves] Combination of two globals?
Matthias70 4009 Nov 5, 2007, 7:46 AM
Thread Re: [Matthias70] Combination of two globals?
neves 4008 Nov 5, 2007, 7:52 AM
Thread Re: [neves] Combination of two globals?
Matthias70 3979 Nov 5, 2007, 8:26 AM
Thread Re: [Matthias70] Combination of two globals?
neves 3982 Nov 5, 2007, 9:36 AM
Thread Re: [neves] Combination of two globals?
Matthias70 3968 Nov 5, 2007, 10:05 AM
Thread Re: [Matthias70] Combination of two globals?
neves 3966 Nov 5, 2007, 10:33 AM
Thread Re: [neves] Combination of two globals?
Matthias70 3956 Nov 5, 2007, 10:43 AM
Post Re: [Matthias70] Combination of two globals?
neves 3975 Nov 5, 2007, 11:29 AM