Totally Zenned
- Join Date:
- Jul 2005
- Location:
- Brooklyn NY
- Posts:
- 498
- Plugin Contributions:
- 0
How to change the search Button?
I want to change the search button to something else but the button is in CSS can some one help with this or can it be done?
Views: 8,868
Totally Zenned
I want to change the search button to something else but the button is in CSS can some one help with this or can it be done?
Totally Zenned
There are 2 search boxes located in your sideboxes folder.
There is the header search and the side box search.
you did not say which search you wanted to change to an image.
If you open your tpl_header_search and locate this code
} else {
$content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';
}
and change to this code:
} else {
$content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"').zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 0px; bottom: 4px"');}
The button is already in your button folder.
If you need to change the side box search let me know and I will give you the code to change that one to an images as well.
New Zenner
I'd like to change the search box button on the sidebox to a picture.
Please help!
Totally Zenned
This is the complete code that you can replace the original code with
<?php
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $
*/
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
$content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
$content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
$content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
$content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
} else {
$content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '<br />' .zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 5px; bottom: 4px"');
$content .= '<br />Or try <a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';}
$content .= "</form>";
$content .= '</div>';
?>
You may need to set the position of your button and if you do in red is what needs to be changed
class="input" style="position:relative;left: 0px; bottom: 0px
New Zenner
Hi, I am now almost desperate in not been able to find info on how to do the same - change the advanced search box on the sidebox to use a transparent picture like in here: http://butiche.com/ and here: http://www.impressionslast.com/. I've made the gif and on, but can't make it to show instead of the rectangular default form...
I've asked put that on the forum here: http://www.zen-cart.com/forum/showthread.php?t=133276 but to no avail still... Please help!!!
Tell staff why this post should be reviewed.