+1-888-365-2779
Try Now
More in this section

Forums / Designing & Styling / Multiple Pager Controls - one on top one on bottom of list

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

5 posts, 0 answered
  1. cli
    cli avatar
    50 posts
    Registered:
    21 May 2007
    02 Aug 2013
    Link to this post
    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
  2. Boyko Karadzhov
    Boyko Karadzhov avatar
    56 posts
    Registered:
    05 Dec 2016
    05 Aug 2013
    Link to this post
    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
  3. Nik
    Nik avatar
    10 posts
    Registered:
    06 May 2013
    03 Nov 2014
    Link to this post

    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

  4. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    05 Nov 2014
    Link to this post
    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
     
  5. Nik
    Nik avatar
    10 posts
    Registered:
    06 May 2013
    07 Nov 2014
    Link to this post

    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.

5 posts, 0 answered