diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 42be62998..5033f2e40 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -7,6 +7,9 @@ Andreas Graf). - Bugfix 914825 / 912203: Bug in template system (LenK). - Apache 2.0 is now the default web server for WebGUI. See gotcha.txt for details. + - Bugfix [ 904313 ] Problem with page-template preview in 6.0.0 + + 6.0.0 diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index e09a371c6..477539acc 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -1388,6 +1388,12 @@ The unique identifier for the selected template. Defaults to "1". The namespace for the list of templates to return. If this is omitted, all templates will be displayed. +=item extras + +If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows: + + 'onChange="this.form.submit()"' + =back =cut @@ -1398,7 +1404,8 @@ sub template { return selectList({ name=>$name, options=>WebGUI::Template::getList($_[0]->{namespace}), - value=>[$templateId] + value=>[$templateId], + extras=>$_[0]->{extras} }); } diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index 6e4f07308..ca6331054 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -290,9 +290,14 @@ sub drawTemplate { $template =~ s/\r//g; $template =~ s/\'/\\\'/g; $template = WebGUI::Macro::negate($template); + $template =~ s/\.*?\<\/style\>//gi; $template =~ s/\.*?\<\/script\>//gi; $template =~ s/\/\/ig; $template =~ s/\.*?\<\/tmpl\_loop\>/$1/ig; + $template =~ s/\.*?\<\/tmpl_if\>//ig; + $template =~ s/\//ig; + $template =~ s/\<\/tmpl_if\>//ig; + $template =~ s/\//ig; return $template; }