Results 1 to 9 of 9
  1. #1
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default custom search button image

    V 1.3.9h

    Hi,

    I have the below
    templates/MY_TEMPLATE/sideboxes/tpl_search_header.php
    file for my search box in the header next to the navMain buttons.
    How do I change the default search button with a custom image (custom_search.gif)?

    Thank you.

    PHP Code:
    <?php
      $content 
    "";
      
    $content .= zen_draw_form('quick_find_header'zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT''$request_typefalse), '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="20" maxlength="30" id="searchTop" 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 .= zen_draw_input_field('keyword''''id="searchTop" size="20" maxlength="30" 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;<input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 45px" />';
      }

      
    $content .= "</form>";
    ?>

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: custom search button image

    Easiest is just to call your custom button_search.gif and put it in your includes/templates/YOUR_TEMPLATE/buttons/YOUR_LANGUAGE folder and let Zen Cart take care of it from there.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: custom search button image

    Thank you.

    I did it, but it's not working.

    I'm sorry I forgot to put the site's link
    amber precious

    As you can see it's stille the default input button.

  4. #4
    Join Date
    Aug 2006
    Location
    Denver CO
    Posts
    63
    Plugin Contributions
    0

    Default Re: custom search button image

    version v1.3.9h
    www.whitewolfjewelry.com (store is not live)

    I'm having the same problem.

    I have replaced the stock button with my custom button called button_search.gif in /includes/templates/MY-TEMPLATE/buttons/english

    The button will show when called up with the full URL so it's not that it's a bad gif.

    I'm at a loss because other custom buttons from that folder show fine....

    Dorothy

  5. #5
    Join Date
    Aug 2006
    Location
    Denver CO
    Posts
    63
    Plugin Contributions
    0

    Default Re: custom search button image

    Forgot to add: the custom search button shows on the Advanced Search page. Just does not display on the main page.

    Dorothy

  6. #6
    Join Date
    Aug 2006
    Location
    Denver CO
    Posts
    63
    Plugin Contributions
    0

    Default Re: custom search button image

    Anyone have any thoughts on this?

    Dorothy

  7. #7
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: custom search button image

    Anyone please can assist?

  8. #8
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: custom search button image

    This is how I solved it:

    in the
    templates/MY_TEMPLATE/sideboxes/tpl_search_header.php
    file I changed this part of code
    PHP Code:
    $content .= zen_draw_input_field('keyword''''id="searchTop" size="20" maxlength="30" 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;<input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 45px" />'
    with this
    PHP Code:
    $content .= zen_draw_input_field('keyword''''id="searchTop" size="20" maxlength="30" 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;<input type="image" src="includes/templates/MY_TEMPLATE/buttons/english/button_search_header.gif" id="searchTopButton" />'
    and played with the css to get it right.

  9. #9
    Join Date
    Aug 2006
    Location
    Denver CO
    Posts
    63
    Plugin Contributions
    0

    Default Re: custom search button image

    That did it! My search is in the left sidebox so I had to work with tpl_search.php.

    Thank you so much for pursuing the answer to this.

    Dorothy

 

 

Similar Threads

  1. Custom search text and button layout.
    By Develop&Promote in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Jul 2010, 09:32 AM
  2. Search Button image
    By mthem2003 in forum Templates, Stylesheets, Page Layout
    Replies: 31
    Last Post: 27 Aug 2009, 01:31 PM
  3. Custom search button
    By high2K in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 7 Mar 2008, 03:01 PM

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