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

Forums / Developing with Sitefinity / Custom Generic Content Control - Shared vs Non-Shared Content

Custom Generic Content Control - Shared vs Non-Shared Content

6 posts, 0 answered
  1. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    12 Oct 2010
    Link to this post
    We have built a custom generic content control using the ContentManager and IContent objects. We create a ContentManager instance using the Generic_Content provider. When we save content, it shows up under the Generic Content module as shared content. Is there a way to save the content so it is not shared? We would like the content that is saved to be page specific like the standard generic content control. I didn't see a property on the IContent object to flag the item as a non-shared item. Is there a built-in meta key I should use? Or, is there a different provider for non-shared content?

    Thanks!
    Jason
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Oct 2010
    Link to this post
    Hi Jason,

    If the content is not shared this means that you you have to set just Content property of GenericContent control( if you have a custom control, you should set the value you have entered to property of type string). All IContent items are shared content.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    12 Oct 2010
    Link to this post
    Ok, I'm not sure I understand exactly what I need to do.

    Our custom control just uses a RadEditor on the front-end. We save the content property of the RadEditor control using the ContentManager class (Generic_Content provider) and IContent objects.

    If we want to save the text from the RadEditor as non-shared content, how would we do that?

    Thanks!
    Jason
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Oct 2010
    Link to this post
    Hello Jason,

    Create a public property of type string and set the value of thjs  property to RadEditor.Content.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Jason Hedges
    Jason Hedges avatar
    22 posts
    Registered:
    16 Jul 2009
    12 Oct 2010
    Link to this post
    Don't use the ContentManager and IContent classes at all then?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Oct 2010
    Link to this post
    Hello Jason,

    Shared content is IContentent object. When the content is not shared this is just a text - string.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered