1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Cannot show Content property of IContent item in All Items View

Cannot show Content property of IContent item in All Items View

6 posts, 0 answered
  1. Nadya
    Nadya avatar
    52 posts
    Registered:
    17 Dec 2008
    04 Aug 2009
    Link to this post
    Hi,

    I am developing a Department module using Sitefinity 3.6 SP2 , which is extending Generic Content Module. I am using as example the Sample Products Module.

    Still I am experiecing the following.
    I do not need anything but email and name in my department .
    Still the control with ID="Editor" is mandatory so I am uysing it to save email in it as :

    <asp:TextBox ID="Editor" Text="<%$Resources:EmailInput %>" runat="server"></asp:TextBox> 

    And there're the problems.

    First I cannot control it's text when it is empty - it is always "Type your content here".

    And since it is not a meta field (I do not have a metafield "Editor" because it is not correct) I do not know how to say to grid that is in the DepartmentItemsList.ascx  to use it and I want to show in the all list name and email of the department.

    I tried with {#Content#} and {#Editor#} but it is just not working.

    Please , any help is appreciated.
    Thanks
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Aug 2009
    Link to this post
    Hi Nadya,

    Thank you for using our services.

    Can you try to do the following? Instead setting your text box for the department e-mail ID to be Editor, create another text box, give it the ID Editor, and set its Visible property to false, like this:
    <asp:TextBox ID="Editor" Visible="false" Enabled="false" runat="server"></asp:TextBox>  

    Now just handle your e-mail metafield as you should. Add a text box that will be associated with e-mail metafield in your <sf:ContentMetaFields ID="MetaFields" runat="server"> tag.

    Please, give this a try and come back to us with the result.

    All the best,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Nadya
    Nadya avatar
    52 posts
    Registered:
    17 Dec 2008
    05 Aug 2009
    Link to this post
    Hi Rado,

    Yes, this is a solution with one remark -
    the text is still "Type your content here...".
    And this text is shown in the preview of the item - DepartmentPreviewView.ascx, which does not make much of a sence.

    Is there a way to change editor control text ?
    I put :


    <
    asp:TextBox ID="Editor" Visible="false" Enabled="false" runat="server" Text=""></asp:TextBox> 


    But the text after saving is "Type your content here...".

    I tried to change it programmatically but couldn't find the appropriate place to do it  - I tried to get the item using its id in one of the .cs files

    ContentManager contentManager = new ContentManager();  
    IContent item = contentManager.GetContent(itemId);  
    item.Content = string.Empty; 

    but the item is always null.

    Please advise.
    Thanks

  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Aug 2009
    Link to this post
    Hi Nadya,

    Thank you for getting back to me.

    You have to perform a similar operation in the DepartmentPreviewView.ascx. Find the tag <telerik:GenericContent> and make the control's property Visible="false". See see sample code line bellow:
    <telerik:GenericContent ID="contentPreview" runat="server" Visible="false"/> 

    This will hide the "Type your content here.." text  in this particular View.

    Best wishes,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Nadya
    Nadya avatar
    52 posts
    Registered:
    17 Dec 2008
    05 Aug 2009
    Link to this post
    Yep - now it's perfect.
    Thanks a lot!
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Aug 2009
    Link to this post
    Hi Nadya,

    Always glad to help. If any other problems should arise in the development of your Sitefinity project, you are more than welcome to contact us.

    All the best,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
6 posts, 0 answered