« search templates that 'remember' | Main | show who you've linked to »

souping up MT search

By using the MTCgi plugin, you can get mt-search.cgi to remember the search parameters that were last passed to it.

MTCgi not only inserts the search parameters back into the search form for the next search, it also makes them available through the <MTCgiParamValue> tag for use in your template. With a little help from the Compare plugin, you can tailor your search template to reflect what the person was looking for. For instance, if the person began their search from your blog index page, the blog's ID number will be passed as a parameter (IncludeBlogs) and the next search will also be in that blog. You can use the <MTIfEqual> tags to display a message only if the value of the IncludeBlogs parameter matches the ID of a certain blog. Or you might want to display a message for searches of all blogs but one; use <MTIfNotEqual>.

There's also the Limit Search to a Particular Category hack. Combining this with MTCgi and Compare allows a high degree of customization of a single search template.

You can view my default search template by going to my templates page and scrolling to the bottom. You can see it in action by accessing my MT search from various of my blogs and blog pages. Depending on where you came from, it will display different messages and allow you different options.

Related

This tip is built on the following tip(s):

The following tip(s) expand on this tip:

This entry is about search. The ten most recent entries also about this topic are:

fast searches with PHP

more ways to soup up MT search

search templates that 'remember'

View all entries about search.

About This Blog

  • Disclaimer: This is a personal site and is not connected with Six Apart, Ltd, the makers of Movable Type
  • Contact me:
  • Readme: What this blog is and is not
  • Reference: Templates for Al-Muhajabah's Islamic Blogs

August 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Tips by Type

Tips by Area

Other ways to read this blog

Feed Subscribe to this blog's feed
(default is RSS 2.0, I also have RSS 1.0 and Atom)

Text-only version
Powered by
Movable Type 3.2