Can I put the search form at the top of our 404 page?

Something like this?

I think it should be possible by hiding the page-not-found-search component at the bottom with a display: none and then inserting the code for the search box at the top using plugin outlets: Adding to plugin-outlets using a theme

You could also add some CSS to modify the textarea width. Note I haven’t really tested any of this, I just tried it directly in the browser console.

This is the code for the search box:

<div class="row">
    <div class="page-not-found-search-top">
      <h2>Search this site</h2>
      <p>
        </p><form action="/search" id="discourse-search">
          <input type="text" name="q" value="">
          <button class="btn btn-primary">Search</button>
        </form>
      <p></p>
    </div>
</div>
3 Likes