additional template variables
This commit is contained in:
parent
8c9159a582
commit
1cf73bc1b3
3 changed files with 21 additions and 1 deletions
|
|
@ -801,6 +801,11 @@ sub processTemplate {
|
|||
%{$_[0]->{_property}},
|
||||
%{$_[2]}
|
||||
);
|
||||
if (defined $_[0]->get("_WobjectProxy")) {
|
||||
$vars{isShortcut} = 1;
|
||||
my ($originalPageURL) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=".$_[0]->get("pageId"));
|
||||
$vars{originalURL} = WebGUI::URL::gateway($originalPageURL."#".$_[0]->get("wobjectId"));
|
||||
}
|
||||
my $namespace = $_[3] || $_[0]->get("namespace");
|
||||
return WebGUI::Template::process(WebGUI::Template::get($_[1],$namespace), \%vars);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,8 +131,15 @@ sub www_view {
|
|||
}
|
||||
$var{description} = $_[0]->get("description");
|
||||
if ($_[0]->get("convertCarriageReturns")) {
|
||||
$var{description} =~ s/\n/\<br\>/g;
|
||||
$var{description} =~ s/\n/\<br\>\n/g;
|
||||
}
|
||||
$var{"description.full"} = $var{description};
|
||||
$var{"description.full"} =~ s/\^\-\;//g;
|
||||
$var{"description.first.100characters"} = substr($var{"description.full"},0,100);
|
||||
$var{"description.first.20words"} = $var{"description.full"};
|
||||
$var{"description.first.20words"} =~ s/(((\S+)\s+){20}).*/$1/s;
|
||||
$var{"description.first.paragraph"} = $var{"description.full"};
|
||||
$var{"description.first.paragraph"} =~ s/^(.*?)\n.*/$1/s;
|
||||
if ($session{form}{makePrintable}) {
|
||||
$var{description} =~ s/\^\-\;//g;
|
||||
$var{isFirstPage} = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue