More in this section

Forums / Developing with Sitefinity / Pulling Shared Content into a Module

Pulling Shared Content into a Module

3 posts, 0 answered
  1. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    21 Mar 2008
    Link to this post
    I would like to create a module that just pulls a piece of shared Generic Content from the datastore and display it. How can I do that?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Mar 2008
    Link to this post
    Hello Briankb,

    Please take our apologies for the delayed response.

    I'm attaching a demo pluggable control written for you. It demonstrates how to get shared generic content and display it. You need just a few Sitefinity API functions and a standard pluggable module.
    Don't forget to add reference to the module in your Sitefinity project, and to register it in web.config file:
    <modules> 
    .. 
        <add type="Demo.CustomModule.DemoModule, Demo" /> 
    .. 
    </modules> 

    Please note that I used the GetContent() method to get all contents as List with IContent objects. GetContent has more overrides that will help you if you want to get content by specified parameters.

    I'm also attaching a screenshot of the result.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    25 Mar 2008
    Link to this post
    thanks a ton!! I was digging into the DB manually and it is quite overwhelming. this will make it much easier.
Register for webinar
3 posts, 0 answered