# Ionize Search module

This module process one search field and returns list of found "indexed" articles.

This modules can be used in 2 modes :

1. "Tags mode"
   The module is called through dedicated tags, in standard Ionize page or article views. The module contains tags definitions and these tags are called by your page or article views. The module's tags returns data as defined by the module.
2. "URL mode"
   The module is used like a single CodeIgniter application, using the standard CodeIgniter MVC approach : The module's controller is called through the URL, gets the data and prints out the view. In this case, the page and article data available through tags are not available This way of using modules is great when refreshing a page element through XHR (Ajax)

## Installation

1. Copy the module's folder into your /modules/ folder,
2. Register the module through the Ionize Modules panel (click on "install"),
3. Create an article view (called for example "search_form_article"), put it in your theme view folder and register it in the Ionize Theme panel.
4. Depending on the mode you choose, edit your view as described below.

### Notes

This module has no admin panel, so you will not fnd any link in the Modules menu of Ionize.

## Tags mode

Your view will typically contain :

    <!-- Display the search form -->
    <ion:search:form />

    <!-- Display results -->
    <ion:search:results>
        <ion:result>
            <ion:url href="true" tag="h3 "/>
            <ion:nb_words tag="p" prefix="Nb occurrences found : "/>
            <ion:content words="25" />
        </ion:result>
    </ion:search:results>

## URL mode

Your view will typically contain

    <div class="article">

    	<ion:title tag="h2" />

    	<ion:subtitle tag="h3" class="subtitle" />

    	<ion:content />

    	<form method="post" action="<ion:base_url />search/find_pure_php">

    	<input id="search-input" type="text" name="realm" value="" />

    	<input type="submit" class="searchbutton" value="<ion:translation term='module_search_button_start' />" />

    	</form>

    </div>

The example does not include the XHR javascript code to update just a part of your page. You will need to develop this part of code.