本文整理汇总了C#中ContentAPI.GetMultiTemplateASPX方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetMultiTemplateASPX方法的具体用法?C# ContentAPI.GetMultiTemplateASPX怎么用?C# ContentAPI.GetMultiTemplateASPX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.GetMultiTemplateASPX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
private void Page_Load(System.Object sender, System.EventArgs e)
{
//Put user code to initialize the page here
Collection cQuickLink = new Collection();
string RedirectPath = string.Empty;
string aliasName = string.Empty;
string zLibPath = string.Empty;
m_refContentApi = new ContentAPI();
Ektron.Cms.UrlAliasing.UrlAliasCommonApi _refUrlCommonApi = new Ektron.Cms.UrlAliasing.UrlAliasCommonApi();
string strNewQuery = Request.ServerVariables["QUERY_STRING"];
if (! (Request.QueryString["ItemID"] == null))
{
itemID =Convert.ToInt64(Request.QueryString["ItemID"]);
strNewQuery = (string) (strNewQuery.Replace((string) ("ItemID=" + itemID), "").Replace("&&", "&"));
}
if (! (Request.QueryString["libID"] == null))
{
libID =Convert.ToInt64(Request.QueryString["libID"]);
strNewQuery = (string) (strNewQuery.Replace((string) ("libID=" + libID), "").Replace("&&", "&"));
}
if (! (Request.QueryString["LinkIdentifier"] == null))
{
strLinkIdentifier = Request.QueryString["LinkIdentifier"];
strNewQuery = (string) (strNewQuery.Replace((string) ("LinkIdentifier=" + strLinkIdentifier), "").Replace("&&", "&"));
}
if (Request.QueryString["FolderID"] == null)
{
bUseQLink = true;
}
else
{
folderID = Convert.ToInt64(Request.QueryString["FolderID"]);
strNewQuery = (string) (strNewQuery.Replace((string) ("FolderID=" + folderID), "").Replace("&&", "&"));
}
if (strLinkIdentifier == "")
{
strLinkIdentifier = "id";
}
if (bUseQLink)
{
//Use quicklink
if (strLinkIdentifier != "ekfrm")
{
aliasName = _refUrlCommonApi.GetAliasForContent(itemID);
}
if (! libID.Equals(null) && libID > 0 && ! (aliasName.Length > 0))
{
Ektron.Cms.API.Library zapi = new Ektron.Cms.API.Library();
aliasName = (string) (zapi.GetLibraryItem(libID).FileName.Replace(m_refContentApi.SitePath, "/"));
}
else
{
cQuickLink = (Collection)m_refContentApi.EkLibraryRef.GetLibraryItemByContentID(itemID, _refUrlCommonApi.ContentLanguage,true);
}
if ((cQuickLink != null) && cQuickLink.Count >0 && aliasName == string.Empty)
{
if (Convert.ToInt32(cQuickLink["LibraryTypeID"]) == 1) //image, do not use the app/sitepath
{
if (Convert.ToInt32(cQuickLink["IsPrivate"]) == 0)
{
RedirectPath = m_refContentApi.SitePath + "assets/" + Server.HtmlDecode(Convert.ToString(cQuickLink["LibraryFilename"]));
}
else
{
RedirectPath = m_refContentApi.SitePath + "privateassets/" + Server.HtmlDecode(Convert.ToString(cQuickLink["LibraryFilename"]));
}
}
else if ((cQuickLink["LibraryFilename"].ToString().IndexOf("javascript:void window.open") >= 0) && (cQuickLink["ContentID"].ToString() != ""))
{
RedirectPath = m_refContentApi.AppPath + "showcontent.aspx?id=" + itemID;
}
else if ((cQuickLink["LibraryFilename"].ToString().ToLower().IndexOf("downloadasset.aspx") >= 0) && (cQuickLink["ContentID"].ToString() != ""))
{
RedirectPath = m_refContentApi.AppPath + cQuickLink["LibraryFilename"].ToString();
}
else if (cQuickLink["LibraryFilename"].ToString().ToLower().IndexOf("linkit.aspx") < 0)
{
// make sure the quicklink doesn't link to this page or it'll be stuck in infinite loop
RedirectPath = m_refContentApi.SitePath + Server.HtmlDecode(Convert.ToString(cQuickLink["LibraryFilename"]));
}
}
else
{
RedirectPath = (string) ((m_refContentApi.SitePath + aliasName).Replace("//", "/")); // If there is an alias it should show if they use linkit as Quicklink.
}
}
if (((RedirectPath == "") && bUseQLink == true) || (bUseQLink == false))
{
// see if content has a multitemplate attached to it first
templateData = m_refContentApi.GetMultiTemplateASPX(itemID);
if (templateData == null)
{
templateData = m_refContentApi.GetTemplatesByFolderId(m_refContentApi.GetJustFolderIdByContentId(itemID));
}
if (Convert.ToString(templateData.FileName).IndexOf("?") >= 0)
{
RedirectPath = m_refContentApi.SitePath + templateData.FileName + "&" + strLinkIdentifier + "=" + itemID;
}
else
{
//.........这里部分代码省略.........