Getting page template data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

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);

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_portal_engine_getting_page_template_data.htm