var docUrl = document.webdavUrl;
var docUrlArray = docUrl.split("/");
var siteName = "";
// parse site name from webdavUrl
for (var lcv = 0; lcv < docUrlArray.length; lcv++) {
if (docUrlArray[lcv] == "Sites") siteName = docUrlArray[lcv + 1];
}
// get site reference from site service
var site = siteService.getSite(siteName);
// define folders to use as templates for each site preset type
var templateMap = [{preset: "site-dashboard", path: "Data Dictionary/Site Folder Templates/Project Site"}];
// loop through templateMap
for (var lcv = 0; lcv < templateMap.length; lcv++) {
// act if site is of the desired preset
if (site.sitePreset == templateMap[lcv].preset) {
// set root node to copy child nodes from
var templateNode = companyhome.childByNamePath(templateMap[lcv].path);
// copy nodes from path to site
for (var n = 0; n < templateNode.children.length; n++) {
templateNode.children[n].copy(document, true);
}
// stop looping through templateMap
lcv = templateMap.length;
}
}
[size=85]var docUrl = document.webdavUrl;
var docUrlArray = docUrl.split("/");
var siteName = "";
// parse site name from webdavUrl
for (var lcv = 0; lcv < docUrlArray.length; lcv++) {
if (docUrlArray[lcv] == "Sites") siteName = docUrlArray[lcv + 1];
}
// get site reference from site service
var site = siteService.getSite(siteName);
// define folders to use as templates for each site preset type
var templateMap = [{preset: "site-dashboard", path: "Data Dictionary/Site Folder Templates/Project Site"}];
// loop through templateMap
for (var lcv = 0; lcv < templateMap.length; lcv++) {
// act if site is of the desired preset
if (site.sitePreset == templateMap[lcv].preset) {
// set root node to copy child nodes from
var templateNode = companyhome.childByNamePath(templateMap[lcv].path);
// copy nodes from path to site
for (var n = 0; n < templateNode.children.length; n++) {
templateNode.children[n].copy(document, true);
}
// stop looping through templateMap
lcv = templateMap.length;
}
}[/size]
You should start by creating the folder to store your templates in. Like I said, I put mine in the data dictionary. Once you have created that folder, you should create another folder inside of it. For this example, I created a template for my company’s project-related Sites in Data Dictionary/Site Folder Templates/Project Site.
1 - en Repositorio > Libreria de datos creo carpeta "Site Folder Templates" y dentro de esta creo "Project Site"
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.