smart search

web dev asked on August 16, 2018 12:43

hello kentico dev i try to apply a smart search while click on button search there is modal in header display result but the problem is that the page load and modal dessaper i want get result without load the page any idea thank you Image

Correct Answer

Arun Kumar answered on August 16, 2018 13:44

You have to filter it on page load based on current page url or by query string value, it should be adding ?searchtext query string in page URL, you can use below code:

<script type="text/javascript">
  $(window).on('load',function(){
   if(window.location.search.indexOf("searchtext")>0)
   {
     $('#myModal').modal('show');
   }
});
0 votesVote for this answer Unmark Correct answer

Recent Answers


Arun Kumar answered on August 16, 2018 12:57

Hi Nadia,

Are you using Smart Search Dialog web part or any custom dialog to show the result page? You can simply use Smart Search Result web part in any page and use that page in your Smart Search Box.

0 votesVote for this answer Mark as a Correct answer

web dev answered on August 16, 2018 13:02

hi Arun Kumar i am using smart search box i just need to click on button search and get the result in a model as you see in image this model apply while click on button search

0 votesVote for this answer Mark as a Correct answer

Arun Kumar answered on August 16, 2018 13:06

If you are using bootstrap modal then you use below code in javascript web part or in external JS file

<script type="text/javascript">
$(window).on('load',function(){
    $('#myModal').modal('show');
});

You can check the page URL or any query string value in that page for which you want to open the search dialog on page load.

0 votesVote for this answer Mark as a Correct answer

web dev answered on August 16, 2018 13:33

but the model keep displaying every load and all i need just while submit value of search show model result

0 votesVote for this answer Mark as a Correct answer

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