本文整理汇总了C#中ContentAPI.LoadContentByIds方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.LoadContentByIds方法的具体用法?C# ContentAPI.LoadContentByIds怎么用?C# ContentAPI.LoadContentByIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.LoadContentByIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainView
protected void MainView()
{
if (ContentBlockId > -1)
{
ContentAPI capi = new ContentAPI();
PageBuilder page = (Page as PageBuilder);
if (ContentBlockId > 0)
{
contentBlock.DefaultContentID = ContentBlockId;
if (page != null && page.CacheInterval > 0)
{
contentBlock.CacheInterval = page.CacheInterval;
}
contentBlock.Fill();
if (contentBlock.EkItem != null)
{
if (contentBlock.EkItem.Title != null)
_host.Title = contentBlock.EkItem.Title;
if (contentBlock.EkItem.AssetInfo != null && contentBlock.EkItem.AssetInfo.FileExtension != null && contentBlock.EkItem.AssetInfo.FileExtension.ToLower() == "flv")
{
StringBuilder sbflash = new StringBuilder(); //need object tag here
sbflash.Append("<embed id=\"ply\" width=\"" + Width + "\" height=\"" + Height + "\"");
sbflash.Append("flashvars=\"file=" + contentBlock.EkItem.AssetInfo.FileName);
if (ThumbnailID > 0)
{
ContentRequest req = new ContentRequest();
req.ContentType = EkEnumeration.CMSContentType.AllTypes;
req.GetHtml = false;
req.Ids = ThumbnailID.ToString();
req.MaxNumber = 1;
req.RetrieveSummary = false;
Ektron.Cms.Common.ContentResult imageresult = capi.LoadContentByIds(ref req, Page);
if (imageresult != null && imageresult.Count > 0)
{
sbflash.Append("&image=" + imageresult.Item[0].AssetInfo.FileName);
}
}
else if (Thumbnail != string.Empty)
{
sbflash.Append("&image=" + Thumbnail);
}
sbflash.Append("&autostart=" + AutoStart.ToString().ToLower() + "\"");
sbflash.Append("allowscriptaccess=\"always\" allowfullscreen=\"true\" quality=\"high\" bgcolor=\"#CCCCCC\" name=\"ply\" style=\"\"");
sbflash.Append("src=\"" + sitePath + "/widgets/Flash/player.swf\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"/>");
ltrFlash.Text = sbflash.ToString();
Ektron.Cms.API.JS.RegisterJSInclude(this, sitePath + "/widgets/flash/swfobject.js", "widgetFlash.js");
contentBlock.Visible = false;
ltrFlash.Visible = true;
}
else
{
//Ektron.Cms.Controls.ContentBlock contentBlock;
if (contentBlock.Text != "")
{
string html = contentBlock.Text;
int startwidth = -1, endwidth = -1, startheight = -1, endheight = -1;
startwidth = html.IndexOf("width=\"") + 7;
if (startwidth > 0)
{
endwidth = html.IndexOf("px", startwidth);
}
startheight = html.IndexOf("height=\"") + 8;
if (startheight > 0)
{
endheight = html.IndexOf("px", startheight);
}
if (startwidth > 0 && endwidth > startwidth && startheight > 0 && endheight > startheight)
{
string pixelwidth = html.Substring(startwidth, endwidth - startwidth);
string pixelheight = html.Substring(startheight, endheight - startheight);
int storedheight = 0;
int storedwidth = 0;
int.TryParse(Width, out storedwidth);
int.TryParse(Height, out storedheight);
if (storedheight > 0) html = html.Replace(pixelheight, storedheight.ToString());
if (storedwidth > 0) html = html.Replace(pixelwidth, storedwidth.ToString());
}
ltrFlash.Text = html;
contentBlock.Visible = false;
ltrFlash.Visible = true;
}
}
}
}
}
enableResize = true;
}