Home > Fluid Dynamics Search Engine > Help > 1108

Advanced Search: Making some realms invisible

Sometimes it makes sense to not display some of the realms in the realms selection box.

For example, let's say you have three realms for the major folders of your site, a fourth small realm with miscellaneous documents outside those folders, and then the "All realms" option. You might want to display the "All" option and the three major realms, while not displaying the fourth realm to end users. The fourth realm would still be searched when "All" is selected, but it wouldn't ever make sense for it to be the only one selected.

The easiest way to implement this is to customize the "searchform.htm" template. Normally it looks like this:

in Search Index:<select name="Realm">
<option value="All">[ All ] %realm_options%</select></TD></TR>

When rendered by the script, it would return this:

in Search Index:<select name="Realm">
<option value="All">[ All ]
<option value="Foo1">Foo1
<option value="Foo2">Foo2
<option value="Foo3">Foo3
<option value="Misc">Misc</select></TD></TR>

To implement the "hidden realm" feature, you simply hardcode the realm select list, rather than depending on the %realm_options% variable. Omit the realms that should be hidden:

in Search Index:<select name="Realm">
<option value="All">[ All ]
<option value="Foo1">Foo1
<option value="Foo2">Foo2
<option value="Foo3">Foo3</select></TD></TR>

The disadvantage of this method is that when you will have to edit your search form template each time you rename, add or delete a realm.


    "Advanced Search: Making some realms invisible"
    http://www.xav.com/scripts/search/help/1108.html