简体   繁体   English

Ektron:通过文件夹ID获取内容-获取文件夹中的所有smartforms吗?

[英]Ektron: Getting content by folder ID - get all smartforms in folder?

I'm new to Ektron, and I'm having trouble finding decent documentation on how to get content. 我是Ektron的新手,我很难找到有关如何获取内容的体面文档。 I have a folder that contains smartforms. 我有一个包含smartforms的文件夹。 In my code, I need to get all those smartforms. 在我的代码中,我需要获取所有这些智能表单。 This is all I have so far: 到目前为止,这就是我所拥有的:

var folderManager = new FolderManager();
var folder = folderManager.GetTree(Convert.ToInt64(ConfigurationManager.AppSettings["AlumniSlideshowFolderId"]));

But from there, I have no idea how to get my data. 但是从那里,我不知道如何获取数据。 Please help! 请帮忙!

Something like this should do the trick. 这样的事情应该可以解决问题。 You'll actually want to use the ContentManager instead of the FolderManager . 您实际上将要使用ContentManager而不是FolderManager The criteria object is pretty powerful... you can refine the list down further if you need to. 条件对象非常强大...如果需要,您可以进一步缩小列表的范围。

var contentManager = new ContentManager();
int recordsPerPage;
int.TryParse(ConfigurationManager.AppSettings["AlumniSlideshow.RecordsPerPage"], out recordsPerPage);

int currentPage;
int.TryParse(HttpContext.Current.Request.QueryString["p"], out currentPage);
if (currentPage <= 0)
{
    currentPage = 1;
}

long alumniSlideshowFolderId;
long.TryParse(ConfigurationManager.AppSettings["AlumniSlideshowFolderId"], out alumniSlideshowFolderId);

var criteria = new ContentCriteria();
criteria.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, alumniSlideshowFolderId);

// By default, the GetList method will use a 'recordsPerPage' value of 50.
criteria.PagingInfo = new PagingInfo(recordsPerPage, currentPage);
var content = contentManager.GetList(criteria);

foreach (var contentData in content)
{
    // work with each result here
}

You also mentioned not finding good documentation. 您还提到找不到好的文档。 Here are a few links. 这里有一些链接。 There is some pretty good documentation available, especially for the newer FrameworkAPI classes. 有一些相当不错的文档,特别是对于较新的FrameworkAPI类。 You just have to know where to look. 你只需要知道去哪里找。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM