Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2010
    Posts
    125
    Plugin Contributions
    0

    Default Customizing The Search Box?

    In the header of my site i have the search field, i would like to customize it in the following way:

    Change the base colour
    Change the border colour
    Replace the button with my own
    Re-size width

    How would i go about doing this?

    (My website http://www.clickpurchase.co.uk) incase neccessary.

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Take a look at this thread:
    Another helpful tip in google search this way:
    site:www.zen-cart.com customize search button
    To change the width and wording in the Search box:
    Search Box
    A. Change Box Size in Search Box
    1. includes/ templates/ override folder/ sideboxes/ tpl_search_header.php
    1. line 17
    2. width= 100 to 135
    3. line 19
    4. width = 100 to 135
    5. ftp the file

    B. Change Wording in Search Box
    1. includes/ languages/ english/ header.php
    1. Line 28
    2. ftp to: includes/ languages/ english/ your template/ header.php

  3. #3
    Join Date
    Mar 2010
    Location
    California
    Posts
    236
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Does anyone have the code and or image to change the Search Button to a Magnifying Glass that they would be willing to share??

    I hope the answer is -

    But I will understand if it is -

    Thanks for thinking about it.

    BigAl

  4. #4
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

  5. #5
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    This should fix you up on how to change the button to an image:

  6. #6
    Join Date
    Mar 2010
    Location
    California
    Posts
    236
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Thanks, I'll give it a try tomorrow and let you know how it goes.

    Al

  7. #7
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    This will help you:
    includes/ templates/ your_template/ sideboxes/ tpl_search_header.php

    From here: } else {

    Replace with this:
    } else {
    $content .=
    '<table border="0" cellpadding="0" cellspacing="0">
    <tr>
    '.'<td valign="middle">';
    $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 . '\';"') .'</td>'.'<td>'. '&nbsp;<input type="image" src="./images/button_search.gif" value="" />' .'</td>'.'</tr></table>';
    }

    $content .= "</form>";
    ?>
    Now it is time to create an image (EX: 20px X 20px) and upload the magnifiying glass image
    includes/ templates/ your_template/ buttons/ english/ button_search.gif
    And you are finished refresh your home page..
    Now will globally change every search button, so if you want to only customize the header and not the sidebox at the same time.

    1. change this:
    2. src="./images/button_search.gif" to this:
    3. src="./images/button_header_search.gif"
    4. and create a new button with this name also upload to your_template/ buttons/ english
    Last edited by haredo; 29 May 2010 at 08:00 AM.

  8. #8
    Join Date
    Mar 2010
    Location
    California
    Posts
    236
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Just got around to having the time to play with that.

    Now the image space has a red x

    Any ideas what could be causing it?

    I put the code in tpl_search_header.php
    Uploaded the image and now nothing.

    Any possibility the code has any mistakes, or is it me again???

  9. #9
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,197
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Please post the code back to me you used..
    What is the name of the image you uploaded????

  10. #10
    Join Date
    Mar 2010
    Location
    California
    Posts
    236
    Plugin Contributions
    0

    Default Re: Customizing The Search Box?

    Here is the code.

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $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 . '\';"') . '&nbsp;' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
    } else {
    $content .=
    '<table border="0" cellpadding="0" cellspacing="0">
    <tr>
    '.'<td valign="middle">';
    $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 . '\';"') .'</td>'.'<td>'. '&nbsp;<input type="image" src="./images/button_mag.gif" value="" />' .'</td>'.'</tr></table>';
    }

    $content .= "</form>";
    ?>
    I named it button_mag.gif.

    Thanks again for the help.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. customizing drop downs and search box look
    By aprilmarie in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Jun 2011, 11:36 PM
  2. Maintaining the user's search query in the advanced search box?
    By arniesbarmyarmy in forum General Questions
    Replies: 0
    Last Post: 26 Feb 2010, 01:27 PM
  3. Customizing search box
    By flipperjoint in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Feb 2008, 02:36 AM
  4. Customizing header search box
    By Sherry Two in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 4 Oct 2007, 08:17 AM
  5. Customizing the look of the header Search form. Submit image and background color.
    By immersive in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 17 May 2007, 07:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg