Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Disable paging in Search Results webpart View modes: 
User avatar
Certified Developer 11
Certified Developer 11
felix.planjer-yellowred - 9/10/2010 8:32:48 AM
   
Disable paging in Search Results webpart
Hi,

I only want 2 results to be returned on my search result page.

In the SearchResults Webpart I set the following properties:

Page size = 2
Max. pages = 1

However, the webpart still displays the paging controls.

How can I disable this?

User avatar
Member
Member
kentico_michal - 9/17/2010 3:34:44 AM
   
RE:Disable paging in Search Results webpart
Hi,

If you want to hide pager and display only two search results please follow instructions:

-open ~\CMSModules\SmartSearch\Controls\SearchResults.ascx.cs file and modify OnPreRender method following way:
protected override void OnPreRender(EventArgs e)
{
Search();
if (this.mMaxPages == 1) pgrSearch.Visible = false;
}

-in the SearchResults Webpart leave the following properties:
Page size = 2
Max. pages = 1

Best regards,
Michal Legen

User avatar
Certified Developer 11
Certified Developer 11
felix.planjer-yellowred - 9/17/2010 4:13:19 AM
   
RE:Disable paging in Search Results webpart
I would expect setting the properties like this:

- Max. Pages =1
- Hide pager for single page = true

Would disable the pager, because there is only one page.... I guess this is a bug?

However, I have found that if setting
- Group Size = -1
Will disable the pager.

regards, Felix

User avatar
Member
Member
kentico_michal - 9/21/2010 7:40:35 AM
   
RE:Disable paging in Search Results webpart
Hi,

Thank you for letting us know about this issue. I have assigned this issue to our testers to test it. If it is really a bug, we will try fix it in the nearest version or in the next hotfix package for this particular Kentico CMS version.

Best regards,
Michal Legen