The following sample code shows how you can get a page template as a PageTemplateInfo object:
[C#]
using CMS.PortalEngine;
...
// Get page template object by template code name PageTemplateInfo pti = PageTemplateInfoProvider.GetPageTemplateInfo("cms.articlelistleftmenu");
// Get page template object by template ID PageTemplateInfo pti2 = PageTemplateInfoProvider.GetPageTemplateInfo(10); |
The following sample code shows how you can get a DataSet containing page templates from the system:
[C#]
using System.Data; using CMS.PortalEngine;
...
string where = "PageTemplateID > 10"; string orderby = "PageTemplateDisplayName";
// Get DataSet of page templates according to the given parameters DataSet ds = PageTemplateInfoProvider.GetTemplates(where, orderby); |