More in this section

Forums / General Discussions / Custom Rendering of Generic Content List

Custom Rendering of Generic Content List

4 posts, 0 answered
  1. Kiran
    Kiran avatar
    12 posts
    Registered:
    14 Sep 2010
    19 Nov 2010
    Link to this post
    Hello,

    I have a requirement where I need to display a set of content blocks in paged manner. To implement this I was expecting List module which was available in version 3.7 but I could not find it in 4.0 beta. I need a way to create a list of content blocks in CMS and access that list from asp.net code and render them in paged manner. Thanks in advance for your support.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    19 Nov 2010
    Link to this post
    Hi Kiran,

    You can create Generic Content items and then display them on a page by Generic content list widget.

    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
  3. Kiran
    Kiran avatar
    12 posts
    Registered:
    14 Sep 2010
    19 Nov 2010
    Link to this post
    Thanks for the immediate reply Ivan.

    I have added a generic content list widget but it is displaying all the generic content blocks which were published. I want only  a particular set of content blocks (Say, all belong to some category) to be displayed on the page. But I have found no way to filter the content items based on categories or tags. Does this generic content list widget allow me to customize the pagination? Or should I get the content items from c# code in a user control and add my own logic to render them in some fashion (in this case paging)?

    If you can provide me a sample code which returns me a list of content items those belong to a particular category and also how to extract the HTML content from those content items, that would be great help to me. I can take it there on and fulfill my requirements.

    Thanks,
    Kiran
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    19 Nov 2010
    Link to this post
    Hi Kiran,

    Please take a look at this post that shows how to filter the control by taxon id. This post shows how to do this porgrammatically.

    The pages is set through MasterGridViewElement. You can change the page size from

    Home > ControlDefinition > Views > GenericContentMasterView when you open the control for editing.

    If you want to modify the logic of the pager you have to create a custom definition and replace the default MastersView with your custom one

    var masterView = new MasterGridViewElement(frontendView.ViewsConfig)
             {
                 Title = "MasterView",
                 ViewName = FrontendMasterViewName,
                 ViewType = typeof(Telerik.Samples.Sitefinity.MasterViewCustom),
                 DisplayMode = FieldDisplayMode.Read,
                 ResourceClassId = resourceClassId,
                 FilterExpression = DefinitionsHelper.PublishedOrScheduledFilterExpression,
                 AllowPaging = true,
                 ItemsPerPage = 20
             };

    MasterViewCustom should inherit from MasterView where you can override the virtual ConfigurePager method or implement a custom pager.


    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
4 posts, 0 answered