Website here → www.greatamerica.com
Issue → Include Landing Pages in custom search function
On our website, there’s a custom search icon/module in the top navigation bar. I’m trying to get this search function to include Landing Pages in the Search Results. The search function is built into the code of the Header Module, so none of the Site Search documentation is helping me.
Any assistance would be helpful!
Here’s the hopefully relevant part of the module.html
<div class="grid__item portable-two-twelfths hard--ends lap-and-up-visuallyhidden">
<div class="header--searchmobile--trigger">
</div>
</div>
<div class="grid__item nine-twelfths portable-visuallyhidden hard text--left">
<div class="grid short hard">
<div class="grid__item one-whole hard--ends text--right">
<div class="header--search">
<form class="header--search--body">
<input class="header--search--input" placeholder="{{ module.search_placeholder_text }}">
</form>
<span class="header--search--trigger"></span>
</div>
<script>
function headerSearchSubmit() {
if ($("body").find(".header--search").hasClass("active")) {
if ($("body").find(".header--search--input").val()) {
if ($("body").find(".header--search--input").val().trim().length > 0) {
window.location.href = "{{ module.search_url_of_search_results_page.href }}?term="+$("body").find(".header--search--input").val().trim();
}
}
}
else {
$("body").find(".header--search").addClass("active");
}
}
$("body").find(".header--search .header--search--trigger").click(function (e) {
e.preventDefault();
headerSearchSubmit();
});
$("body").find(".header--search .header--search--body").submit(function (e) {
e.preventDefault();
headerSearchSubmit();
});
</script>