当前位置: 首页>>代码示例>>C#>>正文


C# ContentAPI.GetMultiTemplateASPX方法代码示例

本文整理汇总了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
                {
//.........这里部分代码省略.........
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:linkit.aspx.cs


注:本文中的ContentAPI.GetMultiTemplateASPX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。