Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2006
    Posts
    40
    Plugin Contributions
    0

    Default Search Sidebox Button

    Hi folks,

    I created a whole new set of buttons for my site including button_search.gif and still I get the plain white html button in the search sidebox. How do I get my nice new shiny search button Name:  button_search.gif
Views: 587
Size:  1.2 KB to show up in the search sidebox?

    I tried a routine posted in 2004 but it didn't work for me. All help greatly appreciated.

    Regards,

    Mark

  2. #2
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Search Sidebox Button

    Had tested with ZC v1.3.0.2 but not sure for v1.3.5.

    Copy the following file
    includes/templates/template_default/sideboxes/tpl_search.php

    And save it to a new file for the use of override
    includes/templates/YOUR_TEMPLATE/sideboxes/tpl_search.php

    Then modify about line 21 with refer to the codes below.

    Note the code below only for reference and for prevous version, also added with comment.
    Please compare with the newest version and make according changes.
    Orginal code
    PHP Code:
        $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 /><input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 50px" />'
    Modified code
    PHP Code:
    //  Orginal use text as button 
    //  $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 = \'\';"') . '<br /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />';
    //  Begin: Modified to use image as button
        
    $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 = \'\';"') . '<br />' zen_image_submit (BUTTON_IMAGE_SEARCHHEADER_SEARCH_BUTTON' style="width: 50px"');
    //  Ended: Modified to use image as button 
    Note:
    Also the about code use the existing botton botton_search.gif as the button.
    Please also modify it according to your requirement.

    .
    Last edited by seethrou; 29 Sep 2006 at 03:43 AM. Reason: Added more info.
    A New Starter again

  3. #3
    Join Date
    Jan 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Search Sidebox Button

    Hi Seethrou,

    You correctly identified the right file and line that needed revision. Thanks. Unforntunately, the 1.3.5 code was revised to include an onblur value that was absent in 1.3.0.2 version and cut and paste didn't work.

    Here is the code I used to get it working:
    PHP Code:
    //    Original use text as button

    //  $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 /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />';
    //    Begin: Modified to use image as button
        
    $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_SEARCHHEADER_SEARCH_BUTTON' style="width: 68px"'); 
    Note that I also changed to style width from the default 50px to 68px so that the button displays full size.

    Thanks for the help. The previous method I tried called for two files to be revised and this method only needed one. Nice to see some of these tasks are being simplified as the cart evolves.

    Have a great day.

    Regards,

    Mark

  4. #4
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Search Sidebox Button

    Thanks for the update!
    A New Starter again

  5. #5
    Join Date
    Aug 2008
    Posts
    1
    Plugin Contributions
    0

    Default Re: Search Sidebox Button

    just the answerer i was looking for. thanks

  6. #6
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

    Default Re: Search Sidebox Button

    thank you, thank you, thank you...I've been looking for this solution off and on for years.

    works perfectly with 1.3.9h

 

 

Similar Threads

  1. search sidebox button
    By patg in forum Bug Reports
    Replies: 0
    Last Post: 11 Feb 2011, 06:36 AM
  2. Image Search Button and Sidebox Header
    By mawson in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 12 May 2010, 03:47 AM
  3. Search Header sidebox Button customisation
    By Develop&Promote in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 14 Apr 2010, 02:20 PM
  4. Search button on sidebox or header
    By tpascubarat in forum General Questions
    Replies: 3
    Last Post: 16 Mar 2009, 04:47 AM
  5. How to change 'Search Button' in sidebox?
    By billybonds in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 21 Jun 2007, 03:00 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