Custom Rendering of Generic Content List

Posted by Community Admin on 03-Aug-2018 08:09

Custom Rendering of Generic Content List

All Replies

Posted by Community Admin on 19-Nov-2010 00:00

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.

Posted by Community Admin on 19-Nov-2010 00:00

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

Posted by Community Admin on 19-Nov-2010 00:00

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

Posted by Community Admin on 19-Nov-2010 00:00

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

This thread is closed