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


C# ContentManager.GetItem方法代码示例

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


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

示例1: Get

        public IEnumerable<ContentData> Get()
        {
            var contentManager = new ContentManager(ApiAccessMode.Admin);
            ContentData contentData = contentManager.GetItem(30, returnMetadata: true);

            return new ContentData[] { contentData };
        }
开发者ID:kevinpriester,项目名称:EktronContrib,代码行数:7,代码来源:ContentController.cs

示例2: Page_Init

    /// <summary>
    /// Page Init
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Init(object sender, EventArgs e)
    {
        RightSideContent.ccontentID = mainForm.EkItem.Id.ToString();
        RightSideContent.cfolderID = mainForm.EkItem.FolderId.ToString();
        uxPageTitle.pgTitle = mainForm.EkItem.Title.ToString();
        uxBreadcrumb.contentID = mainForm.EkItem.Id.ToString();
        uxPageTitle.pageId = mainForm.EkItem.Id.ToString();
        uxPageTitle.ResourceTypeId = "2";

          formID = long.Parse(Request.QueryString["ekfrm"].ToString());

        contactForm.formID = formID.ToString();

        TopDescription = "";

        switch (formID)
        {

            case 112:
                uploadFile.Visible = true;
                break;

        }

        ContentManager contentManager = new ContentManager();
        ContentData cData = new ContentData();
        Boolean returnMetadata = true;
        string result = string.Empty;
        cData = contentManager.GetItem(formID, returnMetadata);
        foreach (ContentMetaData cmd in cData.MetaData)
        {

            if (cmd.Name == "Forms Description")
            {
                getUpperText(cmd.Text);

            }
        }
    }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:44,代码来源:contactSingle.aspx.cs

示例3: SetContentParameters

    /// <summary>
    /// Sets the ContentId and Content fields based on id or page id as specified in the query string
    /// </summary>
    private void SetContentParameters()
    {
        long parsedContentId = 0;

        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        {
            long.TryParse(Request.QueryString["id"], out parsedContentId);
        }
        else if (!string.IsNullOrEmpty(Request.QueryString["pageid"]))
        {
            long.TryParse(Request.QueryString["pageid"], out parsedContentId);
        }

        if (parsedContentId > 0)
        {
            this.ContentId = parsedContentId;
            ContentManager contentManager = new ContentManager();
            this.Content = contentManager.GetItem(this.ContentId, false);
        }
    }
开发者ID:khambley,项目名称:Ektron_Dev1_Training,代码行数:23,代码来源:MainMenu.ascx.cs

示例4: getUpperText

    private void getUpperText(string contentIDd)
    {
        try
        {
            if (long.Parse(contentIDd) > 0)
            {
                ContentManager contentManager = new ContentManager();
                ContentData cData = new ContentData();
                Boolean returnMetadata = true;
                string result = string.Empty;

                cData = contentManager.GetItem(long.Parse(contentIDd), returnMetadata);
                TopDescription = cData.Html;

            }
        }
        catch { }
    }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:18,代码来源:contactSingle.aspx.cs

示例5: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (ContentId != 0)
         {
             ContentManager contentManager = new ContentManager();
             ContentData registerIntro = contentManager.GetItem(ContentId, false);
             if (registerIntro != null)
             {
                 litTitle.Text = registerIntro.Title;
                 litContent.Text = registerIntro.Html;
             }
         }
     }
 }
开发者ID:khambley,项目名称:Ektron_Dev1_Training,代码行数:16,代码来源:Register.aspx.cs

示例6: Page_Init

    /// <summary>
    /// Page Init
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Init(object sender, EventArgs e)
    {
        RightSideContent.ccontentID = mainForm.EkItem.Id.ToString();
        RightSideContent.cfolderID = mainForm.EkItem.FolderId.ToString();
        uxPageTitle.pgTitle = mainForm.EkItem.Title.ToString();
        uxBreadcrumb.contentID = mainForm.EkItem.Id.ToString();
        uxPageTitle.pageId = mainForm.EkItem.Id.ToString();
        uxPageTitle.ResourceTypeId = "2";
        try
        {
            formID = long.Parse(Request.QueryString["formID"].ToString());
        }
        catch
        {
            formID = 113;
            mainForm.DefaultFormID = 113;
            mainForm.Fill();

        }
        if (!IsPostBack)
        {

            contactForm.formID = formID.ToString();

            TopDescription = "";

            switch (formID)
            {

                case 112:
                    uploadFile.Visible = true;
                    break;

            }

            ContentManager contentManager = new ContentManager();
            ContentData cData = new ContentData();
            Boolean returnMetadata = true;
            string result = string.Empty;
            cData = contentManager.GetItem(formID, returnMetadata);
            foreach (ContentMetaData cmd in cData.MetaData)
            {

                if (cmd.Name == "Forms Description")
                {
                    getUpperText(cmd.Text);

                }
            }

            selectOutput = "<option  value=''>- Select a subject -</option>";
            Dictionary<long, string> contenIdTitles = commonfunctions.getCollectionContentIds(24);
            foreach (var a in contenIdTitles)
            {
                //ListItem li = new ListItem();
                //li.Text = a.Value;
                //li.Value = "option" + i.ToString();
                //contactSelect.Items.Add(li);
                //dt.Rows.Add(a.Key);
                //  Response.Write(a.Key);
                if (a.Key == formID)
                {
                    selectOutput += "<option selected value='" + a.Key + "'>" + a.Value + "</option>";
                }
                else
                {
                    selectOutput += "<option value='" + a.Key + "'>" + a.Value + "</option>";
                }
                //adding forms
                // i++;
            }
        }
    }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:78,代码来源:contact.aspx.cs

示例7: getSideWidget

    public void getSideWidget(long MaincontentID)
    {
        string resultView = string.Empty;
        XmlDocument contentXML = new XmlDocument();
        string mySidebar = string.Empty;

        ContentManager contentManager = new ContentManager();
        ContentData cData = new ContentData();
        Boolean returnMetadata = true;
        string result = string.Empty;

        cData = contentManager.GetItem(MaincontentID, returnMetadata);
        foreach (ContentMetaData cmd in cData.MetaData)
        {

            if (cmd.Name == "Side Widget Content")
            {
                mySidebar = cmd.Text;

            }
        }

        if (mySidebar == "")
        {
            getAssignedCollection();
        }
        else
        {

            string[] swIds = mySidebar.Split(new string[] { ";" }, StringSplitOptions.None);

            foreach (string swId in swIds)
            {
                sideWidgetContent += getSideWidgetDetails(long.Parse(swId));
            }
        }
        // resultView += getSideWidgetDetails(mySidebar);

        //  return resultView;
    }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:40,代码来源:RightSideColumn.ascx.cs

示例8: GetNewsSpotLightContent

 /// <summary>
 /// This method is used to get spot light news content from metadata
 /// </summary>
 private void GetNewsSpotLightContent(long ResourceSpotlightID)
 {
     try{
     ContentManager contentManager = new ContentManager();
     ContentData cData = new ContentData();
     Boolean returnMetadata = true;
     string result = string.Empty;
         string title = cData.Title;
     cData = contentManager.GetItem(ResourceSpotlightID, returnMetadata);
     string teaser = getSubString(cData.Teaser);
     ltrNewsSpotlight.Text = "<p><a title=" + title + " aria-label=" + title + " href=\"" + cData.Quicklink + "\">" + teaser + "</a></p>";
     } catch {}
     //long homeContentId = ConfigHelper.GetValueLong("HomePageCId");
     //var homeContentData = ContentHelper.GetContentById(homeContentId, true);
     //if (homeContentData != null && homeContentData.MetaData != null)
     //{
     //    long metaSpotLightId = ConfigHelper.GetValueLong("MetaHomePageNewsSpotLightId");
     //    var metaHomeNews = homeContentData.MetaData.Where(x => x.Id == metaSpotLightId).FirstOrDefault();
     //    if (metaHomeNews != null && metaHomeNews.Text != string.Empty)
     //    {
     //        long newsSpotLightCId = EktUtility.ParseLong(metaHomeNews.Text);
     //        var newsSpotLightData = SiteDataManager.GetNewsById(newsSpotLightCId);
     //        if (newsSpotLightData != null && newsSpotLightData.SmartForm != null)
     //        {
     //            if (!string.IsNullOrEmpty(newsSpotLightData.SmartForm.Teaser))
     //                ltrNewsSpotlight.Text = "<p><a href=\"" + newsSpotLightData.Content.Quicklink + "\">" + newsSpotLightData.SmartForm.Teaser + "</a></p>";
     //            else
     //                ltrNewsSpotlight.Text = "<p><a href=\"" + newsSpotLightData.Content.Quicklink + "\">" + newsSpotLightData.SmartForm.Headline + "</a></p>";
     //        }
     //    }
     //}
 }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:35,代码来源:Default.aspx.cs

示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserData userToEdit = userManager.GetItem(Ektron.Cms.CommonApi.Current.UserId, true);

            if (userToEdit != null && Ektron.Cms.CommonApi.Current.UserId != 0)
            {
                // Set all of the field values to the current user's details
                txtFirstName.Text = userToEdit.FirstName;
                txtLastname.Text = userToEdit.LastName;
                txtEmail.Text = userToEdit.Email;
                txtPhone.Text = userToEdit.CustomProperties["Phone"].Value.ToString();
                ((DropDownList)ddlCountrylist).SelectedValue = userToEdit.CustomProperties["Country"].Value.ToString();
                txtUsername.Text = userToEdit.Username;
                txtPassword.Attributes.Add("value", userToEdit.Password);
            }

            if (ContentId != 0)
            {
                ContentManager contentManager = new ContentManager();
                ContentData registerIntro = contentManager.GetItem(ContentId, false);
                if (registerIntro != null)
                {
                    litTitle.Text = registerIntro.Title;
                    litContent.Text = registerIntro.Html;
                }
            }
        }
    }
开发者ID:khambley,项目名称:Ektron_Dev1_Training,代码行数:30,代码来源:EditProfile.aspx.cs


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