diff --git a/etemplate/js/et2_widget_template.js b/etemplate/js/et2_widget_template.js index 29d02532ab..1e5bc0245e 100644 --- a/etemplate/js/et2_widget_template.js +++ b/etemplate/js/et2_widget_template.js @@ -103,7 +103,8 @@ var et2_template = et2_DOMWidget.extend( { // Ask server var splitted = template_name.split('.'); - var path = this.egw().webserverUrl + "/" + splitted.shift() + "/templates/default/" + + // use template base url from initial template, to continue using webdav, if that was loaded via webdav + var path = this.getRoot()._inst.template_base_url + splitted.shift() + "/templates/default/" + splitted.join('.')+ ".xet" + (cache_buster ? '?'+cache_buster : ''); if(splitted.length) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 46bce852d6..c8c2c527a1 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -273,6 +273,8 @@ etemplate2.prototype.download = function(_url) etemplate2.prototype.load = function(_name, _url, _data, _callback) { this.name = _name; // store top-level template name to have it available in widgets + // store template base url, in case initial template is loaded via webdav, to use that for further loads too + this.template_base_url = _url.split(_name.split('.').shift())[0]; egw().debug("info", "Loaded data", _data); var currentapp = this.app = _data.currentapp || window.egw_appName;