More in this section
Forums / Developing with Sitefinity / Generic based module - API

Generic based module - API

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. __dave__
    __dave__ avatar
    1 posts
    01 Feb 2005
    09 Nov 2010
    Link to this post
    Hi, I've sucessfully created a Generic content based module, Workshops. In the administration area, I can add, edit and delete, everything's great. Next I need to create a custom control to display items is a formatted list (I need to group by categories etc...).

    Here's a sample of code that I've been trying to use to get a single item (hard-coded id for testing).:

    Telerik.Cms.Engine.ContentManager contentManager = new Telerik.Cms.Engine.ContentManager("Workshops");
    Telerik.Cms.Engine.IContent theContentItem;
    theContentItem = contentManager.GetContent(new Guid("f7814ca4-630c-4107-b6c8-f6626ff2a1db"));
    Response.Write(theContentItem.GetMetaData("DatesLocations").ToString() + "<br />");

    theContentItem and meta data fields are always null, I can get regular generic content items with no problems. Am I missing something?

    thanks in advance.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    09 Nov 2010
    Link to this post
    Hi __dave__,

    If the content item is null, then you do not have an item with the ID you are trying to find it. The metadata is null or Empty.String if you have not set any value to it. Here is a link to all methods that you can use to find, filter, sort etc list of IContent items.

    Kind regards,
    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
2 posts, 0 answered