Getting page layout 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 pre-defined page layout as a LayoutInfo object:

 

[C#]

 

using CMS.SiteProvider;

 

...

     

        // Get layout object by layout code name

        LayoutInfo li = LayoutInfoProvider.GetLayoutInfo("LayoutCodeName");

 

        // Get layout object by layout ID

        LayoutInfo li2 = LayoutInfoProvider.GetLayoutInfo(1);

 

The following sample code shows how you can get a DataSet containing pre-defined page layouts from the system:

 

[C#]

 

using System.Data;

using CMS.SiteProvider;

 

...

 

        string where = "LayoutID > 10";

        string orderby = "LayoutCodeName";

        int topN = 10;

        string selectedColumns = "LayoutCodeName,LayoutCode";

 

        // Get dataset of page layouts according to the given parameters

        DataSet ds = LayoutInfoProvider.GetLayouts(where, orderby);

 

        DataSet ds2 = LayoutInfoProvider.GetLayouts(where, orderby, topN, selectedColumns);

 

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