New templateurl variable.

This commit is contained in:
Chris 2013-09-13 11:38:31 +01:00
parent 84ea3c8d72
commit b0458a66db

View File

@ -111,6 +111,7 @@
# - `{V_[templatepath]}` is replaced by the path from the base of the web
# application to the template directory (useful for image and other resource
# paths inside the template). This will always have a trailing '/'.
# - `{V_[templateurl]}` like templatepath, but including the full URL.
# - `{V_[commonpath]}` is replaced by the path from the base of the web
# application to the common template directory (useful for image and other resource
# paths inside the common template). This will always have a trailing '/'.
@ -355,6 +356,9 @@ sub set_template_dir {
$self -> {"templatepath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"theme"});
$self -> {"templatepath"} .= "/" unless($self -> {"templatepath"} =~ m|/$|); # templatepath must have trailing slash
# The URL...
$self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"});
# And the common path, if possible
if($self -> {"fallback"}) {
$self -> {"commonpath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"fallback"});