Multiple Pager Controls - one on top one on bottom of list

Posted by Community Admin on 05-Aug-2018 17:58

Multiple Pager Controls - one on top one on bottom of list

All Replies

Posted by Community Admin on 02-Aug-2013 00:00

I'm trying to put the pager control for a list of news items on both the top and the bottom.  It appears it only picks up a pager if the id=pager so I only get the first one rendered.  Is there a way to do something like this?  Below is my template code.

<sf:Pager id="pager" runat="server"></sf:Pager>
 
... news items ...
 
<sf:Pager id="pager2" runat="server"></sf:Pager>

thanks

Posted by Community Admin on 05-Aug-2013 00:00

Hi,

The MasterListView for News is configuring a Pager with exactly this ID - "pager". To configure another Pager you will have to replace the MasterListView with a custom class that does the job.

Create a class like this in your SitefinityWebApp:

namespace SitefinityWebApp
    public class CustomMasterListView : Telerik.Sitefinity.Modules.News.Web.UI.MasterListView
    
        protected override void InitializeListView(IQueryable<Telerik.Sitefinity.News.Model.NewsItem> query, int? totalCount)
        
            base.InitializeListView(query, totalCount);
 
            if (totalCount.HasValue && totalCount.Value != 0)
            
                var pager2 = this.Container.GetControl<Pager>("pager2", false);
                if (pager2 != null)
                
                    this.ConfigurePager(pager2, totalCount.Value);
                
            
        
    

You might need to add a reference to Telerik.Sitefinity.ContentModules assembly to access the MasterListView class.

After you have built this go to Administration -> Settings -> Advanced -> News -> Controls -> NewsFrontend -> Views -> NewsFrontendList. There set ViewType to "SitefinityWebApp.CustomMasterListView, SitefinityWebApp".

Regards,
Boyko Karadzhov
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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 03-Nov-2014 00:00

I realize this is an old thread, but didn't appear to work for me.

 The ViewType in admin didn't match what you said, and it doesnt seem to be saving it if I add customMasterListView to the field...

Telerik.Sitefinity.Modules.News.Web.UI.MasterListView, Telerik.Sitefinity.ContentModules

 

Using v7.2.53

Posted by Community Admin on 05-Nov-2014 00:00

Hello Nik,

I have answer you in the support ticket.

Once you have the solution you can share it with the community.

Regards,
Svetoslav Manchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 07-Nov-2014 00:00

Turns out it didn't like me adding the viewtype to what was there. Once I cleared the ViewType field and pasted in SitefinityWebApp.Custom.CustomMasterListView, it saved and started working.

This thread is closed