« Blog Downtime - Tuesday Aug. 22 10-11 am | Main | Searching a single blog - Update »

September 15, 2006

Searching a single blog

There is a problem in the way that Movable Type searches individual blogs.

The problem is that if you do a search, and then search again using the search form you find on the results screen, Movable Type loses track of which blog you were in, and ends up searching the entire site.

To fix this, I created a new Movable Type search template that only searches one blog.

Update: Please ignore the following directions. Rather than reconfiguring every blog to use a custom search template, I've changed the default search template so that it only searches one blog.


To use this template, you need to add an extra field to your search form to tell MT to use the 'oneblog' template.

By default, you'll find search forms on the Main Index and Master Archive Index templates for each blog. Edit each of these templates and add a hidden 'Template' field to each search form.

Here's an example:

<form method="get" action="<$MTCGIPath$><$MTSearchScript$>">
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
<input type="hidden" name="Template" value="oneblog" />
<input id="search" name="search" size="20" class="blog_search_text" />
<input type="submit" value="Go" class="blog_search_text" />
</form>

Posted by elf123 at September 15, 2006 11:03 AM     Topic(s):