Hi,
I’m trying to create an inline search that should only search for pages with a specific parent page. I tried copying the html for the inline form from Cornerstone, but it only displays when i’m logged in and not on logged out browsers. My parent page has the ID=16. So when using the search form, it should only search for child pages of that parent page. This is my code so far, but it’s not working properly:
<form class="el6 x-search" data-x-search="{"search":true}" action="http://www2.filecamp.com/" method="get">
<label class="visually-hidden" for="s-el6">Search</label>
<input id="s-el6" class="x-search-input" type="search" name="s" tabindex="" placeholder="Search the Knowledge Base" style="outline: none;">
<button class="x-search-btn x-search-btn-submit" type="button" data-x-search-submit="" tabindex=""><span class="visually-hidden">Submit</span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-1 -1 25 25"><circle fill="none" stroke-width="1" stroke-linecap="square" stroke-miterlimit="10" cx="10" cy="10" r="9" stroke-linejoin="miter"></circle><line fill="none" stroke-width="1" stroke-linecap="square" stroke-miterlimit="10" x1="22" y1="22" x2="16.4" y2="16.4" stroke-linejoin="miter"></line></svg></button>
<button class="x-search-btn x-search-btn-clear" type="button" data-x-search-clear="" tabindex=""><span class="visually-hidden">Clear</span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-1 -1 25 25"><line fill="none" stroke-width="1" stroke-linecap="square" stroke-miterlimit="10" x1="19" y1="5" x2="5" y2="19" stroke-linejoin="miter"></line><line fill="none" stroke-width="1" stroke-linecap="square" stroke-miterlimit="10" x1="19" y1="19" x2="5" y2="5" stroke-linejoin="miter"></line></svg></button>
<input type="hidden" name="post_parent" value="16" />
</form>
Is there a better way of adding a parameter to the inline search element from cornerstone? Maybe with JS?
Thanks in advance!
Johan