Search

Search is a module for searching "core" content along with certain registered modules. You put in a word or two and it gives you back matching, relevant results.

You can see the search module in use in the default templates, like on this page. Simply put search tag in your template, where you want the search form to appear.

{search}

If you want the results of a search to appear on a different page, you can specify this with the parameter:

{search resultpage='page-alias'}

For more information, see the Search module in the Admin Panel, in the Extensions menu.

   Customizing result template

The Search module also searches in some modules. You can influence the search results by using {if $entry->module == 'Modulename'}

<h3>{$searchresultsfor} &quot;{$phrase}&quot;</h3>
{if $itemcount > 0}
<ul>
{foreach from=$results item=entry}
{if $entry->module == 'Products'}
<li>Webshop - <a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
{elseif $entry->module == 'Guestbook'}
<li>Another guestbook name - <a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
{else}
<li>{$entry->title} - <a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
{/if}
{/foreach}
</ul>
<p>{$timetaken}: {$timetook}</p>
{else}
<p><strong>{$noresultsfound}</strong></p>
{/if}