ATUS Home

Adding the new search to your site

As of July 2011, Western has a new and improved search utility for campus websites. You can integrate the new search utility into your site by editing some HTML in your share.

First decide whether you want the search to search the entire Western site or just your site. (see Search Entire Western Site)

Search Local Site Only

  1. If your website is NOT hosted on campusweb, please contact webhelp to request that a collection be made for your site. Specify collection name and URLs to include in the search. In the meantime you can incorporate a search of the whole Western site.
  2. In your website, open includes/search.html with the a web editing tool such as Dreamweaver, or with a text editor.
    • If using Dreamweaver, find and select Code in the top-left corner of your screen.
  3. You should see the following text:
    <div class="searchForm">
       <form method="get" action="http://www.google.com/u/WWU" 
              id="mainsearch">
          <label class="hide" for="searchfield">Search Terms:</label>
          <!--
          Use the tag below to restrict the search to your website
          <input type="hidden" name="hq" value="inurl:www.wwu.edu/lgbtcc/">
          -->
          <input type="text" id="searchfield" name="q" size="17" 
             maxlength="50" value="search" 
             onblur="if(this.value=='')this.value='search';" 
             onfocus="if(this.value=='search')this.value='';" 
             title="Enter your keywords here"/>
          <input type="submit" id="searchgo" value="go" 
             title="Click here to search" />
       </form>
    </div>
  4. Save a backup copy now, in case the changes don't work correctly. Go to File > Save As... and save a copy as the filename search-old.html. Next, repeat this step using search.html. This establishes that the working copy is different from the backup, and prevent you from overwriting your backup.
  5. First, replace the action inside of the <form> tag:
    <div class="searchForm">
       <form method="get" action="http://gsa.ts.wwu.edu/search">
       ...
  6. Remove the code that looks like this:
    <!-- Use the tag below to restrict the search to your  website-->
    <input type="hidden" name="hq" value="inurl:www.wwu.edu/cfpa/">
  7. Next, add the following code before the closing </form> tag. On the last line, replace Sharename with your share name, capitalized. For example, www.wwu.edu/lgbtac/ would use Lgbtac in place of Sharename:
    
          <input type="hidden" name="client"  value="default_frontend">
             <input type="hidden" name="output"  value="xml_no_dtd">
             <input type="hidden" name="proxystylesheet"  
                value="default_frontend">
             <input type="hidden" name="sort" value="date:D:L:d1">
             <input type="hidden" name="oe" value="UTF-8">
             <input type="hidden" name="ie" value="UTF-8">
             <input type="hidden" name="ud" value="1">
             <input type="hidden" name="exclude_apps" value="1">
             <input type="hidden" name="site" value="Sharename">
  8. The final code should look like this, again with your capitalized sharename in place of Sharename:
    <div class="searchForm">
       <form method="get" action="http://gsa.ts.wwu.edu/search">
          <label class="hide" for="searchfield">Search  Terms:</label>
                                                                                                     
           <input type="text" id="searchfield" name="q"  size="17" 
              maxlength="50" value="search"  
              onblur="if(this.value=='')this.value='search';"  
              onfocus="if(this.value=='search')this.value='';" 
              title="Enter your keywords here"/>
           <input type="submit" id="searchgo" value="go"  
              title="Click here to search" />
    
           <input type="hidden" name="client" value="default_frontend"> 
              <input type="hidden" name="output" value="xml_no_dtd"> 
              <input type="hidden" name="proxystylesheet"  
                 value="default_frontend"> 
              <input type="hidden" name="sort" value="date:D:L:d1"> 
              <input type="hidden" name="oe" value="UTF-8">
              <input type="hidden" name="ie" value="UTF-8"> 
              <input type="hidden" name="ud" value="1"> 
              <input type="hidden" name="exclude_apps" value="1">
              <input type="hidden" name="site" value="Sharename">
       </form>
    </div>
  9. Save as search.html.
  10. Go to your website and test the new search. If something isn't right, you can rename the file you just saved (search.html) as search-new.html, then rename your backup as search.html. The site will use whichever file is named search.html, so it's important to keep a consistent system of making backups and saving your work. If you accidentally write over a backup, call ATUS.

Search Entire Western Site

Use this code if you wish to search the entire Western Site:

<form class="searchform" method="get" 
action="http://gsa.ts.wwu.edu/search" target="_parent"> <div class="infolinks"> <!-- For GSA --> <input name="site" type="hidden" value="default_collection" /> <input name="client" type="hidden" value="default_frontend" /> <input name="output" type="hidden" value="=xml_no_dtd" /> <input name="proxystylesheet" type="hidden" value="default_frontend" /> <!-- End For GSA --> </div> <div id="searchrow"> <label class="hide" for="searchfield">Search Terms:</label> <input type="text" id="searchfield" name="q" size="17" maxlength="50"
value="search" onBlur="if(this.value=='')this.value='search';"
onFocus="if(this.value=='search')this.value=' ';"/> <input type="submit" id="searchgo" value="" /> </div> </form>