Drupal 6 - Theme custom search form results I have a custom search form written in my custom-module. On submit, i have used do_search api and then I have made some modifications/customization with the results.

Now having my customized results, how can I render them?

Work so far--->


In custom-module.module

function custom_module_search_ticket_form_submit($form, $form_state) {
   // do_search()
   //  customizations (in the sense, removed few results according to my requirements. Otherwise the result-object/array format is same as of core search results) 

    return theme('rootcandy_my_search_results', $results, $type);
}

function custom_module_theme() {
  return array(
    'rootcandy_my_search_result' =&gt; array(
      'arguments' =&gt; array('result' =&gt; NULL, 'type' =&gt; NULL),
      'template' =&gt; 'rootcandy-my-search-result',
    ),
    'rootcandy_my_search_results' =&gt; array(
      'arguments' =&gt; array('results' =&gt; NULL, 'type' =&gt; NULL),
      'template' =&gt; 'rootcandy-my-search-results',
    ),
  );
}

Rootcandy is the theme I have used. In rootcandy's template.php    

function rootcandy_preprocess_rootcandy_my_search_results (&amp;$vars)  {
  // copied lines from core search module's search.pages.inc function template_preprocess_search_results(&amp;$vars)
}

function rootcandy_preprocess_rootcandy_my_search_result (&amp;$vars) {
  // copied lines from core search module's search.pages.inc function template_preprocess_search_result(&amp;$vars) 
}

Under rootcandy theme folder, Added below tpl.php files

rootcandy-my-search-results.tpl.php  (copied from core search's search-results.tpl.php)
rootcandy-my-search-result.tpl.php   (copied from core search's search-result.tpl.php)



Now I have done this much, clearing cache, after everything; Submitting my custom-search-form renders nothing, other than the form. When I print my customized results, they are fine. Theming part is not working.

Where is the mistake? Plz help !
Whatever u have done so far is correct. Only thing left now is to render the content from ur preprocess 'rootcandy_preprocess_rootcandy_my_search_results' to ur 'rootcandy-my-search-results.tpl.php'. U have to start debugging in this way.


Check ur $vars['form'] contains ur form values in  'rootcandy_preprocess_rootcandy_my_search_results'
create a variable in preprocess and try using it in ur rootcandy-my-search-results.tpl.php.
Eg: $vars['testing'] = "this is to confirm that variable is working in rootcandy-my-search-results.tpl.php"
if you print $testing in ur rootcandy-my-search-results.tpl.php and it gives "this is to confirm that variable is working in rootcandy-my-search-results.tpl.php" Which means its working fine.
Then you can pass ur form results to the tpl file. 
Eg: $vars['result'] = drupal_render($vars['form']['result']);


Try this. Ur first goal will be making sure u can get ur preprocess values in ur tpl file.