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

Changing Search Button to an image

Locked

Views: 1,906

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
22 Sep 2007, 3:28 AM
#1
mcanes avatar

mcanes

Zen Follower

Join Date:
May 2007
Posts:
210
Plugin Contributions:
0

Changing Search Button to an image

Can someone please tell me how to switch the search button that is used in the header to an image instead of a button? I am assuming this is something I will need to do in the .CSS.

Thanks in advance

22 Sep 2007, 7:15 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Changing Search Button to an image

I'm having a hard time figuring out what you mean by "switch the search button ... to an image instead of a button." Buttons can be images or text. If it's currently an image (default ZC set up), just replace it with another that you like better, in the appropriate images folder.

But if you're using css buttons, and the search button is therefore just text, then the answer is almost the same. :smartalec:

To override a single CSS button by an image button:

Copy the image button to:
includes/templates/YOUR_TEMPLATE/buttons/english/

For example copy:
includes/templates/template_default/buttons/english/button_search.gif
to:
includes/templates/YOUR_TEMPLATE/buttons/english/button_search.gif

(You can, of course, edit this image so it looks like whatever you wish. But user studies suggest strongly that it should say "Search" or whatever is appropriate for the language your site uses, no matter what it looks like.)

Be sure to turn on Zen Cart's css buttons under admin / Configuration / Layout Settings / CSS Buttons. Otherwise your search button can not be changed to a css button.

HTH

Rob

30 Sep 2007, 4:09 PM
#3
sherry_two avatar

sherry_two

New Zenner

Join Date:
Jul 2007
Posts:
6
Plugin Contributions:
0

Re: Changing Search Button to an image

Hi rstevenson, that's what i'm trying to do too as i've explained in this post, it seems not to work when CSS buttons is ON. Any idea?

Thanx

4 Oct 2007, 3:44 AM
#4
semaphore avatar

semaphore

New Zenner

Join Date:
Oct 2007
Posts:
2
Plugin Contributions:
0

Re: Changing Search Button to an image

I'm having a similar issue... images not showing for the search image after enabling css buttons. After looking at the code,... I can get the image to show, by adding an alt tag that is greater than 30 chars. Can someone tell me why it uses a different function when the length is >30?

code :

if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /, $parameters = ''/ );

Thanks!