I'm hooking / theming preprocess_search_theme_form and using an image for my button, so I have to add to the src member of the submit array. This is all well and good and the code is going in the right place, but the path is going to the path of the search module, not the path of the theme as this should be:

$vars['form']['submit']['#attributes'] = array(
'id' => t('searchgo'),
'src' => t( base_path() . path_to_theme() . '/images/search_go.jpg')
) ;
src="/website/modules/search/images/search_go.jpg"

should be sites/all/themes/images/search_go.jpg

Is there a different function I should be using? I am subbing off Zen btw.

Thanks!
Adam

Comments

daniel.a.lopez’s picture

Dealing with the same problem here not sure if its a coincidence or not but using zen theme as well. under

function() MyThemeName_preprocess{
}

returns modules/search

daniel.a.lopez’s picture

http://drupal.org/node/194098 seems to be covering the same topic, i think?

Here is my quick practical workaround:

MyThemeName_preprocess(&$vars, $hook) {

	global $theme_key;
	
	$path_to_theme = drupal_get_path('theme', $theme_key);


}