How to over-ride search form generated code from sub-theme

Not applicable

Greetings all.

We need to re-style the search form in the Apigee Responsive theme from our sub-theme. We also need to change it's location (it needs to be placed into the main navigation). I see that the search code appears to be generated from the base theme's template.php via apigee_responsive_form_search_form_alter() and _apigee_responsive_search_form_submit().

However when I try to over-ride these in my sub-theme's template.php file, nothing different happens. I've also tried changing the name of the functions to match my sub-theme's name, ie. mytheme_form_search_form_alter() but that doesn't work either. Can someone please give me some pointers?

Thanks!

Solved Solved
1 5 378
1 ACCEPTED SOLUTION

Dear @north.krimsly ,

  • You need to override page.tpl.php file in your sub theme.
  • Copy page.tpl.php from /profiles/apigee/themes/apigee_responsive/templates/pages/page.tpl.php to your sub theme templates folder.
  • Change page.tpl.php code to replace search form from main container to header area. See attached .txt file of page tpl. Below is the line which renders search form in page.tpl.php.
<?php print render($search);?>

Cheers,

Anil Sagar

View solution in original post

5 REPLIES 5

Dear @north.krimsly ,

  • You need to override page.tpl.php file in your sub theme.
  • Copy page.tpl.php from /profiles/apigee/themes/apigee_responsive/templates/pages/page.tpl.php to your sub theme templates folder.
  • Change page.tpl.php code to replace search form from main container to header area. See attached .txt file of page tpl. Below is the line which renders search form in page.tpl.php.
<?php print render($search);?>

Cheers,

Anil Sagar

Anil, that works thanks. I'm wondering though what the functions in the base theme's template.php do? (apigee_responsive_form_search_form_alter() and _apigee_responsive_search_form_submit().

@north.krimsly , Glad.. Your issue is resolved 🙂

Not applicable

More specifically, which file generates the HTML code for the search form? I need to modify how the code gets generated.

@north.krimsly , Please post it as a separate question so that we don't lose context and it will be helpful to others too searching for similar answers.