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
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
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
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