Creating User-Defined Function for Storing Search Data
You can define your own function for storing search data.
Edit the .htedit file and assign your event handler to the event onGenerateSearch.
<? $suEVENTS = Array( 'onGenerateSearch' => string file_name:string function_name ); ?>
|
The parameter file_name specifies the name of a SiteSupra console application to include.
The parameter function_name specifies the name of the function to call.
The file should be located under SiteSupra directory.
Example
<? $suEVENTS = Array( 'onGenerateSearch' => '_mysearch:mySearch' // include file /supra/su__mysearch.php and execute function mySearch() ); ?>
|
SiteSupra passes three parameters to your function.
The first parameter search is an array of page title and short description and properties of all blocks at that page having parameter search set to one.
The search array contains only properties of the blocks belonging to the page and does not contain properties of the blocks belonging to the page template.
Parameter suDOC is $suDOC array.
Parameter blocks is an array of blocks properties belonging to the both page and its template.
<? function mySearch(mixed search, mixed suDOC, mixed blocks) { // Your code for preparing search string goes here return search_string; } ?>
|
Array search has the following structure:
<? $search = Array( 'title' => string page_title, 'short' => string page_short_description, string block_system_name:string property_name => string property_value, ... ); ?>
|