Create a Web Area Search Form

EPA builds all web content in the Drupal WebCMS as of January 2013. All new microsites and resource directories will be created using Drupal.  There is still content on EPA's legacy servers and this content will be maintained there until it is transformed and moved into the Drupal WebCMS.  The following information should be used only for minor updates/maintenance of existing pages; any significant updates or revisions to existing pages should be done in the context of One EPA Web content transformation into the Drupal WebCMS

OEI will provide basic filtered search capabilities for Drupal WebCMS that do no require the author to code their own search form.   Instructions for specialized, dedicated search pages on Drupal WebCMS will be provided shortly.

There are two search collections: public access and intranet. The search box at the top of the One EPA Web template is coded to search the entire public access collection.

Should you want to search your Web Area, you can create your own Web Area search form. These forms can be embedded into content pages. The same rules apply for forms in static and dynamic content.

  1. All parameter names must be in lower case.
  2. Parameter values may not contain <>&\.
  3. Use commas or vertical bars (|) to separate multiple terms in the value.

Basic search form example

Search the Web Guide:

Search Form Code

<form action="" method="get">
<div class="form-item form-type-textfield">
<label for="what-look">What are you looking for?</label>
<input class="form-text" id="what-look" name="querytext" size="40" type="text" value="" /> <!-- do not edit the name attribute-->
<input class="form-submit" type="submit" value="Search Web Guide" /> <!-- Edit to reflect your web area name -->
<input name="typeofsearch" type="hidden" value="area" /> <!-- do not edit -->
<input name="fld" type="hidden" value="|webguide" /> <!-- Add the URL segment you want to search for; the initial pipe is required -->
<input name="areaname" type="hidden" value="Web Guide" /> <!-- Name of your Web Area -->
<input name="areacontacts" type="hidden" value="" /> <!-- Contact form for your Web Area -->  <input name="filter" type="hidden" value="sample4filt.hts" /> <!-- do not edit -->
<input name="result_template" type="hidden" value="epafiles_default.xsl" /> <!-- do not edit -->

Top of Page

Required Search Fields

Name Values Comments
action intranet
typeofsearch area
area searched only your web area.  Do not edit.  
epa searches the entire agency
areaname The plain English name of your area as it should appear in the search results. Keep it short! No ampersands (&).
fld URL string Separate multiple values with the pipe character (|). 
result_template epafiles_default.xsl(for public access)
agcyintr_default.xsl(for intranet)
Extensible style language stylesheet to render results. Do not edit (on public access pages).
querytext   Textbox for entering search terms.  Do not edit.

Top of Page

Optional Search Parameters

The fields below are optional both for intranet and public access search forms.  Do not specify the parameter if you are accepting the default.

Optional Search Fields
Name Values Comments
areacontacts A valid URL If present, this will be the link for "Contact us" in search results. If not present, "Contact us" will link to the Agency contact page.
areasearchurl A valid URL If present, this will be the link for "Advanced Search" in search results. If not present, "Advanced Search" will link to Agency advanced search.
doctype all | html | pdf Controls the type of document to return.  Default is all.  Use all except in special cases, since the user will have the opportunity to refine from the search results page.
sort term_relevancy
Controls ordering of search results. Default is relevancy.
xml no
Controls whether results are in XML format, or in HTML for visual presentation. Default is "no". "yes" is typically used by applications requesting results in machine-readable format.
stylesheet Custom stylesheet
Overrides the default EPA public access or intranet stylesheet.  

Top of Page