Documentation > CMS Template API Library > PanelEntry > GetPanels(String,SortOrder)
GetPanels
Creates a sublist from the current list.
public List<PanelEntry> GetPanels(String,SortOrder)
Returns
List of PanelEntry objects containing panels.
Parameters
Name | Description | Type |
---|---|---|
name | The name of the panel | System.String |
sort | Optional: Sorts the data before returning. Does not work if the source is an inputForm | CrownPeak.CMSAPI.SortOrder |
Code Example
C#
Sample:
List<PanelEntry> panels = asset.GetPanels("panelName"); if (panels.Count > 0) { // Get the upload called "thumbnail" from the first panel UploadedFile file = panels[0].UploadedFiles["thumbnail"]; if (file != null) // save another copy panels[0].SaveUploadedFile("save_thumbnail", file); }