Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Template Related Questions View modes: 
User avatar
Member
Member
Yalın - 3/12/2010 9:38:51 AM
   
Template Related Questions
1 - How can we assign templates to sites in "mass" as opposed to the standard technique which is :

Site Manager > Page Templates > (For Each) Drop-down Template Folder > (For Each) Select Template > Select Site Tab > Click Add Site > Select Site > Click OK

2 - How do we hide the template folders which are not in use (All Templates Disabled within them) from displaying to the end user, currently all of the template folders show, even though they are empty (because the templates in them are disabled), which is not a desirable behavior.

User avatar
Member
Member
Jay - 3/13/2010 6:01:59 AM
   
RE:Template Related Questions
Doesn't appear to be a way to do either of these things in the interface - sounds like the API is your only option. However I'm not even sure you will be able to do the second item, there doesn't seem to be a security context around the template folders.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/15/2010 8:59:59 AM
   
RE:Template Related Questions
Hello,

Jay says correctly that you could ensure this behavior by API. The basic method is:

PageTemplateInfoProvider.AddPageTemplateToSite(pageTemplateId, siteId);

See the API Reference here: http://devnet.kentico.com/downloads/kenticocms_api.zip

Regards the empty folders: we will change this behavior in the next (5.5) version. Now, it works in this way because of performance, however, we will improve it in the next version.


Best regards,
Helena Grulichova