Show number of results of smart search result in content after of smart search box.

Anand Dev Singh asked on July 31, 2014 12:26

Hi Team,

I am using two web parts "Smart search box" and "Smart search results" at the same page to search on the site. Now my need is how can i show the number of results at the content after field of smart search box. Such as (

Correct Answer

Matúš Chamula answered on August 6, 2014 16:09

Thank you for your query.

As per our conversation you'll need to adjust the "Smart search results" since it's not possible to achieve this within the "Smart search box". In "Smart search results" webpart properties please go to Pager desing section and hit the Edit button for the Pager layout item. Then please insert the following code to the transformation.

<div class='ResultCount'><%# Eval("Items") + " result(s) for " + CMS.Helpers.URLHelper.GetUrlParameter(CMS.Helpers.RequestContext.CurrentURL,"searchtext") %></div>

Then you can style the ResultCount class with CSS (by clicking the Add CSS styles button in the Transformation properties window) and use abolute positioning to place it below the search box.

I hope you'll find this information helpful.

Best regards, Matúš Chamula

1 votesVote for this answer Unmark Correct answer

Recent Answers


Anand Dev Singh answered on August 7, 2014 06:48

Thank you so much. It works for me.

0 votesVote for this answer Mark as a Correct answer

Saurav Kumar answered on February 22, 2016 13:22

Hi Matus,

I need to show the total number of items in the result set similar to what you had with Eval("Items") but I need in the Item Transformation. The DataItemsCount shows only the items count in the current container but I need the total count. The Eval("Items") do not work there.

Is there any way I can achieve this ?

Regards, Saurav

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.