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