More in this section

Forums / General Discussions / Customize Pager in Search results

Customize Pager in Search results

4 posts, 0 answered
  1. Mikhail
    Mikhail avatar
    4 posts
    Registered:
    10 Dec 2008
    08 Feb 2011
    Link to this post
    Hi,

    I want to customize layout of sitefinity:Pager in search results template.
    How can I do this?

    Thank you,
    Mikhail
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2011
    Link to this post
    Hi Mikhail,

    You can open SearchResults control for editing and then choose the template you want to use. From the control designer  you can edit the template directly. SearchResults contains the Page control at the bottom of the control template. You could set LayoutTemplatePath and map the template of the pager

    <%@ Control Language="C#" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
     
    <sf:SitefinityHyperLink ID="cmdFirst" runat="server" Text="<%$Resources:Labels, Paging_First %>" />
    <sf:SitefinityHyperLink ID="cmdPrev" runat="server" Text="<%$Resources:Labels, Paging_Prev %>" />
    <div runat="server" id="numeric" class="sf_pagerNumeric"></div>
    <sf:SitefinityHyperLink ID="cmdNext" runat="server" Text="<%$Resources:Labels, Paging_Next %>" />
    <sf:SitefinityHyperLink ID="cmdLast" runat="server" Text="<%$Resources:Labels, Paging_Last %>" />


    Another option is overriding the css classes that are set over the pager like sf_PagerCurrent

    Kind regards,
    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. Mikhail
    Mikhail avatar
    4 posts
    Registered:
    10 Dec 2008
    10 Feb 2011
    Link to this post
    Thanks for your answer, but I have one small issue.

    I have added to my template this code:

    <%@ Control Language="C#" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
    test1
    <sf:SitefinityHyperLink ID="cmdFirst" runat="server" Text="First" />
    test2
    <sf:SitefinityHyperLink ID="cmdPrev" runat="server" Text="Previous" />
    <div runat="server" id="numeric" class="sf_pagerNumeric"></div>

    But in HTML result I see this:

    <div id="MainContentArea_MainContentPageArea_C001_ctl00_pager">
             
    test1
     
    test2
     
    <div id="MainContentArea_MainContentPageArea_C001_ctl00_pager_ctl00_ctl00_numeric" class="sf_pagerNumeric">
    .....
    </div>
    </div>

    How can I resolve this issue?

    Thanks,
    Mikhail
  4. Alexander
    Alexander avatar
    1 posts
    Registered:
    09 Feb 2011
    11 Feb 2011
    Link to this post
    Btw, if we use these buttons "next", "prev", "first", "last", they  do nothing.
4 posts, 0 answered