Change Default Search category on home page
I want to eliminate the big Search bar and use the top search bar instead.
Also how can I hide "All Requests" text?
Best Answer
-
Geoff_Ross Cireson Consultant O.G.Hi Adrain,
You can change the search option with the following:var searchParam = $("input[name=search_param]"); //the hidden field which holds the search type id var searchConcept = $("span[id=search_concept]"); //the span field which displays the search type value var searchInput = $('[class="navbar__search--input form-control k-input"]') //the input where the placeholder sits searchParam.val("KnowledgeBase"); searchConcept.html('Knowledge Base'); searchInput.attr("placeholder","Knowledge Base")
You'll need to get this to run when the URL equals the homepage URL only, else the default search will always be Knowledge Base. Also, timing might be an issue as you need to wait for the page to load. A mutation observer would be best but a simple JavaScript timeout would do the job.
As for hiding the 'All Requests'
JavaScript:$('div[data-bind="visible: catalogVisible"]>h3').hide();
or CSS:#servicecat-content > div > div > div:nth-child(2) > h3 { display:none; }
CSS is probably easier - again for the timing issue.
Geoff5
Answers
You can change the search option with the following:
You'll need to get this to run when the URL equals the homepage URL only, else the default search will always be Knowledge Base. Also, timing might be an issue as you need to wait for the page to load. A mutation observer would be best but a simple JavaScript timeout would do the job.
As for hiding the 'All Requests'
JavaScript:
or CSS:
#servicecat-content > div > div > div:nth-child(2) > h3 { display:none; }
CSS is probably easier - again for the timing issue.
Geoff