Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Search button to an image

Search button to an image

Locked

Views: 1,728

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
4 Apr 2008, 8:35 PM
#1
trudesign avatar

trudesign

New Zenner

Join Date:
Feb 2006
Posts:
72
Plugin Contributions:
0

Search button to an image

Hi there, I want to change the gray box (NOT the search header image) button that says search to an image. I do not want CSS buttons, but images only. It works everywhere else except for the search button. The button that you use to submit your search. Please help!

http://www.cupcakecuddles.com

4 Apr 2008, 8:52 PM
#2
trudesign avatar

trudesign

New Zenner

Join Date:
Feb 2006
Posts:
72
Plugin Contributions:
0

Re: Search button to an image

Also there is a line showing up in IE under the shop and info sidebox and I cannot see where it's coming from... any ideas?

8 Apr 2008, 1:09 PM
#3
brookiewookie avatar

brookiewookie

New Zenner

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
77
Plugin Contributions:
0

Re: Search button to an image

Im after this too, if I figure it out I will let you know

14 Jun 2008, 7:32 PM
#4
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

Re: Search button to an image

Has anyone figured this out?!
Thanks

2 Sep 2008, 6:20 AM
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Search button to an image

SHokuf:

http://www.zen-cart.com/forum/showthread.php?t=90303&highlight=search+header+image&page=2
I searched high and low to another solution to editing this sidebox code like this, but I could not find another solution anywhere.. So reluctantly, I edited the sidebox. However, I did not like the idea of using a URL for the image location (as is suggested in the link Shokuf posted), and preferred to stick to using a relative link instead. Plus I wanted to maintain consistency by using the same location as other Zen buttons. Hope this is useful to others..

If it helps.. here is the code I used to fix my search sidebox. Copy the tpl_search.php from the default_template to your own template folder as follows: includes/templates/YOUR_TEMPLATE/sideboxes/tpl_search.php. I used this in ZenCart version 1.3.8a, and it worked perfectly! Please see the highlighted section. Change "YOUR_TEMPLATE" to the name of your template folder.

<?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 />[B]<input type="image" src="includes/templates/YOUR_TEMPLATE/buttons/english/button_search.gif" value="" />[/B]';
    $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
  }

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