Using ExpressionEngine’s Simple Search Form In eeSiteKit
EE’s Simple Search Form is actually quite powerful when used wisely. It can be set up to search an entire website, or just one channel making it a great localized search tool. For this site, we’re using it to help people find things in the User Guide without them having to look through results from other Channels of the site.
eeSiteKit has already pre-configured 99% of the search form for you. You’ll be adding your Channel Short Names to complete its configuration.
- Click on the Templates and open up the “kit_forms/search” template.
- Near the top of the form look for the exp:search:simple_form tag.
- Within the tag you’ll see: weblog=‘home|ADD_CHANNEL_NAME|ADD_CHANNEL_NAME’
- Being careful not to delete the single quotes, replace the words “ADD_CHANNEL_NAME” with the Channel Short Names of all the site Channels you want to be search-able. Separate each Channel’s Short Name with a bar/pipe as shown in the example code.
- The Channel “home” is optional, you may removed it if you don’t want content in your home page to show up in search results.
- The result page parameter is set up for multilingual websites by default. You’ll find the path set in the language files as this helps get multilingual search results. If you site will only have one language, you can remove the embed tag and set the path as showing in the “kit_language/english_usa” template.
- Click Update
Removing the “index.php” segment from the search results URI requires you to remove “index.php” from the path.php file in you public directory if you have added settings to that file (or you are using MSM). Look for this: $site_index = “”; in the path file and make sure that index.php has been removed.
