Here is a simple code snippet for those who want to make some of the submit buttons on their Drupal website image buttons:
[code lang="php"]
function MYTHEME_button($element) {
if ($element['#value'] == t('Search')) {
$element['#src'] = drupal_get_path('theme', 'MYTHEME') . '/images/search_button.png';
$element['#button_type'] = 'image_button';
}
if ($element['#button_type'] == 'image_button') {
return theme_image_button($element);
}
else {
return theme_button($element);
}
}
[/code]
The above code goes into your template.php file in your theme folder. Make sure to rename MYTHEME with your theme name. You can look up $element[‘#value’] from the page code, it is the ‘value’ of the button element. The code snippet is for Drupal 6.




