How to Create an API Question/Search Box
Hello!
I am trying to create a search widget for our company homepage that will allow the visitors to our site to ask a question and search the community at the same time. I know this is a REST API call, but I am just wondering if anybody can point me in the right direction. I am sure that somebody else has created a box like this before, and I hoping that somebody can point me to a code example.
I have uploaded an image to show the kind of functionality that we were looking for...
This might not be what you're going for, but we did a board-level search component that when executed will take the user to the search interface. The results are specific to the board from which they searched (plus its TKB). Here is the code:
<div class="lia-panel lia-panel-standard hp-three-column custom-search-widget"> <div class="lia-decoration-border"> <div class="lia-decoration-border-top"> <div> </div> </div> <div class="lia-decoration-border-content"> <div> <div class="lia-panel-heading-bar-wrapper"> <div class="lia-panel-heading-bar"> <span class="lia-panel-heading-bar-title">${text.format("custom.search.title")}</span> </div> </div> <div class="lia-panel-content-wrapper"> <div class="lia-panel-content"> <form class="lia-form-all-words-input lia-form-type-text lia-form-input-vertical" id="search_monger_form" method="GET" action="/t5/forums/searchpage/tab/message"> <input type="hidden" id="search_monger_filter" name="filter" value="location" /> <input type="hidden" id="search_monger_location" name="location" value="Board:${coreNode.id}" /> <input style="margin: 0px 5px 0px 5px;" type="text" class="lia-form-type-text search-input lia-search-input-message" name="q" id="search_monger_q" value=""><br/> <input style="margin: 5px 0px 0px 5px;" type="submit" class="lia-button lia-button-secondary lia-button-searchForm-action" id="search_monger_submit" name="search_submit" value="Search" /> </form> </div> </div> </div> </div> <div class="lia-decoration-border-bottom"> <div> </div> </div> </div> </div>
Thank you for your post! This worked perfectly! Much appreciated!!:)