I have installed exsearch and it works fine. I am able to redirect to redirect the user to a specific page for showing the results. My problem is that I want to show the results at a place on the "show-results" page which I control. Like if I want to show the results in the div: <div id="show-results"><!-- results from ezSearch here --> </div>.
You might be right but I am not quite sure about what you mean.
In my master I put in the ezSearch Razor script by this code <div class="myHeaderClass">@Umbraco.RenderMacro("ezSearch")</div>
In the form of the ezSearch I put in a action: <form action="/my_page_for_showing_results/" method="GET" class="ezsearch-form navbar-form" role="search">
If I put in your fine piece of code must I then use the Id of "my_page_for_showing_search_results/" page where I want to show the results? I don't understand what new {rootContentNodeId = "1064"} does!
You might be right but I am not quite sure about what you mean.
In my master I put in the ezSearch Razor script by this code <div class="myHeaderClass">@Umbraco.RenderMacro("ezSearch")</div>
In the form of the ezSearch I put in a action: <form action="/my_page_for_showing_results/" method="GET" class="ezsearch-form navbar-form" role="search">
If I put in your fine piece of code must I then use the Id of "my_page_for_showing_search_results/" page where I want to show the results? I don't understand what new {rootContentNodeId = "1064"} does!
Make sure the action points to the URL for where you're rendering your ezSearch macro. The name of the input field being "q" is important for the ezSearch macro to get textstring of the items searched.
Thank you for you reply. Your idea is fine and works for the top. My final solution was to make an extra parametre, "showResults", a boolean. I set it to false the search form is shown, but not the results. In the other macro the macro is reversed showing only the results. Settings of the parametre is hard-coded.
Here is the code to show the results:
if (showResults == true) {
@RenderSummary(model)
@RenderResultsRange(model)
@RenderResults(model)
if (model.TotalPages > 1)
{
@RenderPager(model)
}
}
if (model.SearchFormLocation == "bottom" || model.SearchFormLocation == "both")
{
if (showResults == false) {
@RenderForm(model)
}
}
}
Redirect ezsearch results
Hi there
I have installed exsearch and it works fine. I am able to redirect to redirect the user to a specific page for showing the results. My problem is that I want to show the results at a place on the "show-results" page which I control. Like if I want to show the results in the div: <div id="show-results"><!-- results from ezSearch here --> </div>.
Does anyone know how to do that?
/Lars
Hi Lars
You should be able to simply put the macro inside the div like this for instance
Hope this helps.
/Jan
Hi Jan
Thank you for a quick reply.
You might be right but I am not quite sure about what you mean.
/Lars
Hi Jan
Thank you for a quick reply.
You might be right but I am not quite sure about what you mean.
/Lars
It looks like you want to separate the search input and button from the search results.
Inside the div that you want the only the results to show, put this piece of code there.
Setting the variable "searchFormLocation" to "NONE" hides the search input and button fields from the macro and only displays the results.
For the search field and button in your header, put something like this:
Make sure the action points to the URL for where you're rendering your ezSearch macro. The name of the input field being "q" is important for the ezSearch macro to get textstring of the items searched.
I hope this helps!
Hi Tessa
Thank you for you reply. Your idea is fine and works for the top. My final solution was to make an extra parametre, "showResults", a boolean. I set it to false the search form is shown, but not the results. In the other macro the macro is reversed showing only the results. Settings of the parametre is hard-coded.
Here is the code to show the results:
is working on a reply...