Moodle search box

For one reason or another, I’ve been very much involved in setting up Moodle based sites lately. We have a project rolling out eLearning platforms to most Local Authorities in the East of England, and the foundation for these is Moodle 2.1

In the way Moodle is configured a search tool only really exists for courses if you add a list of courses to the front page of the site. It is included as part of that, so I was hunting through the code looking for ways to put the search box in other places.

It turns out to be quite simple. All you have to do is add a new HTML block to the menu bar and type in the following:

<form action="http://www.sitedomainname/search.php" method="get">Search Courses: <input type="text" name="search" size="12" alt="Search Courses" /> <input type="submit" value="go" /></form>

This creates the search box, passes the entered string to the built in Moodle searh scripts and returns the result to the main part of the page.

Very easy, very good to have. Of course, you could also add this to individual pages, courses and whatever, but with a block in the menu you can specify whether it appears only on the front page, or throughout the site. Moodle can’t get much simpler… 🙂