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


C# ContentAPI.GetFolderIdForContentId方法代码示例

本文整理汇总了C#中ContentAPI.GetFolderIdForContentId方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetFolderIdForContentId方法的具体用法?C# ContentAPI.GetFolderIdForContentId怎么用?C# ContentAPI.GetFolderIdForContentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentAPI的用法示例。


在下文中一共展示了ContentAPI.GetFolderIdForContentId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPageBuilderEditAnchor

    public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary)
    {
        //make popup window with link to this pageids wireframe, and pass in the id and an edit flag
        ContentAPI capi = new ContentAPI();
        FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id));
        AliasData aliasData = new AliasData();

        string URL = "";
        AliasSettings aliasSettings = ObjectFactory.GetAliasSettingsManager(this.m_refAPI.RequestInformationRef).Get();
        if (aliasSettings.IsAliasingEnabled)
        {
            IAliasManager aliasManager = ObjectFactory.GetAliasManager(this.m_refAPI.RequestInformationRef);
            aliasData = aliasManager.GetAlias(Id, languageId, EkEnumeration.TargetType.Content);
            URL = aliasData.Alias;
        }

        // Note that the internal API changed, if a content items has a default alias it will be passed into this funciton as param quicklink.
        // Keeping this code incase other places are calling this function without alias in quicklink param
        if (String.IsNullOrEmpty(URL))
        {
            URL = quickLink;
        }

        // If it is a multi site, use the quicklink as the alias will not function in other domains. ALias is tied to domain.
        if (fd.IsDomainFolder && aliasData != null && !string.IsNullOrEmpty(aliasData.TargetURL))
        {
            URL = aliasData.TargetURL.TrimStart('/');
        }
        else if (fd.IsDomainFolder)
        {
            URL = URL.TrimStart('/');
        }

        if (URL.Contains("?"))
        {
            URL = URL + "&ektronPageBuilderEdit=true";
        }
        else
        {
            URL = URL + "?ektronPageBuilderEdit=true";
        }
        if (URL.IndexOf("LangType=") == -1)
        {
            URL = URL + "&LangType=" + languageId.ToString();
        }
        URL = this.m_refAPI.SitePath + URL;

        URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary);
        return URL;
    }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:50,代码来源:StyleHelper.cs

示例2: EditEvent

    void EditEvent(string settings)
    {
        try
        {
            tabTesting.Visible = _ShowTestingTab;

            string webserviceURL = _api.SitePath + "widgets/contentblock/CBHandler.ashx";
            // Register JS
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronClueTipJS);
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
            JS.RegisterJSInclude(this, _api.SitePath + "widgets/contentblock/behavior.js", "ContentBlockWidgetBehaviorJS");

            // Insert CSS Links
            Css.RegisterCss(this, _api.SitePath + "widgets/contentblock/CBStyle.css", "CBWidgetCSS"); //cbstyle will include the other req'd stylesheets
        Ektron.Cms.Framework.UI.Packages.jQuery.jQueryUI.ThemeRoller.Register(this); //cbstyle will include the other req'd stylesheets

            JS.RegisterJSBlock(this, "Ektron.PFWidgets.ContentBlock.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.ContentBlock.setupAll('"+ ClientID  +"');", "EktronPFWidgetsCBInit");

            IsGoogleMultivariate = cbMultiVariate.Checked;
            GoogleSectionName = tbSectionName.Text;

            ViewSet.SetActiveView(Edit);

            if (ContentBlockId > 0)
            {
                tbData.Text = ContentBlockId.ToString();
                ContentAPI capi = new ContentAPI();
                long folderid = capi.GetFolderIdForContentId(ContentBlockId);
                tbFolderPath.Text = folderid.ToString();
                while (folderid != 0)
                {
                    folderid = capi.GetParentIdByFolderId(folderid);
                    if (folderid > 0) tbFolderPath.Text += "," + folderid.ToString();
                }
            }
        }
        catch (Exception e)
        {
            errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
            _host.Title = _host.Title + " error";
            ViewSet.SetActiveView(View);
        }
    }
开发者ID:jaytem,项目名称:minGit,代码行数:44,代码来源:ContentBlock.ascx.cs

示例3: GetPageBuilderEditAnchor

    public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary)
    {
        //make popup window with link to this pageids wireframe, and pass in the id and an edit flag
        ContentAPI capi = new ContentAPI();
        FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id));

        string URL = "";
        Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon();
        URL = u.GetAliasForContent(Id);

        if (URL == string.Empty || fd.IsDomainFolder)
        {
            URL = quickLink;
        }

        if (URL.Contains("?"))
        {
            URL = URL + "&ektronPageBuilderEdit=true";
        }
        else
        {
            URL = URL + "?ektronPageBuilderEdit=true";
        }
        if (URL.IndexOf("LangType=") == -1)
        {
            URL = URL + "&LangType=" + languageId.ToString();
        }
        URL = this.m_refAPI.SitePath + URL;
        URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary);
        return URL;
    }
开发者ID:jaytem,项目名称:minGit,代码行数:31,代码来源:StyleHelper.cs


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