Skip to content

Modular search v3.1

Patrick Upson edited this page Jan 16, 2014 · 1 revision

Custom site searches can be setup by copying the wet-boew-php/demos-php/search/search.php file to the local website directory structure and setting the $_SITE['wb__search_file'] variable to point to the file with the custom search form.

This is an GCWU theme example of what a search.php might look like::

<form action="searchURL.php" method="post">
     <div id="gcwu-srchbx-in">
          <label for="gcwu-srch"><?php echo $_SITE['wb_search_label_' . $_PAGE['lang1']]; ?></label>
          <input id="gcwu-srch" name="search" type="search" value="" size="27" maxlength="150">
          <input id="gcwu-srch-submit" name="gcwu-srch-submit" type="submit" value="<?php echo $_SITE['wb_search_'.$_PAGE['lang1']] ?>">
     </div>
</form>

Customize:

  • searchURL.php - Replace this with the full URL of the website's search engine.
  • name="search" - replace "search" with whatever field name the search engine likes.
  • Add any additional hidden type fields, if the site requires them.
  • Change the POST to a GET as needed.

The information for the from can usually be obtained from CMS' existing search form. For Google Site Search engine, see Google's documentation for a sample form. Don't change anything else that might affect the appearance of the form or it won't display correctly in the WET theme.