Zen Cart Logo

header search-field

Views: 686

Results 1 to 7 of 7
3 May 2011, 5:38 PM
#1
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

header search-field

I'm looking for a way to restrict the width of this element: #navMainSearch form[method="get"] located in tpl_search_header.php

I've tried targeting the element with CSS and setting width to either a lower percentage or pixel value. It's not working great...

3 May 2011, 5:40 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,179
Plugin Contributions:
0

Re: header search-field

Is this what you are asking?

Change Box Size in Search Box
A. includes/ templates/ template_default/ sideboxes/ tpl_search_header.php
When done place into the override structure of your site if you are using..

B.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
3 May 2011, 5:54 PM
#3
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: header search-field

Thanks! Didn't get the right hang of it so I'm posting my code here > if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'no') {

$content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="" width="100 to 150" 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 . '\';"') . ' ' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);

} else {
$content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="" width="100 to 150" 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 . '';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';
}

https://www.test.soundfactory.nu

3 May 2011, 5:57 PM
#4
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,179
Plugin Contributions:
0

Re: header search-field

I see your problem..

You have now this: width="100 to 150"

What I meant is this:
width="150"

3 May 2011, 6:12 PM
#5
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: header search-field

I have to write it like this: 'size="6" maxlength="30" style="width:150px" value="' otherwise I don't get any results/changes. The issue is with the form[method="get"] displaying out of the box (out of the green text field, the one containing the magnifying glass). It produces the unfavorable effect of pushing or forcing my search button further to the right instead of closer to the left (which is what I would like)...

3 May 2011, 6:19 PM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,179
Plugin Contributions:
0

Re: header search-field

Ok, change file back to it's original if this was not the right process.. Post a link please or Pm me the link... So I can view in Firefox with the add on called Firebug to see if we can control the spacing within the stylesheet.css

3 May 2011, 6:59 PM
#7
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: header search-field

Sure. Thanks! The link is: https://www.test.soundfactory.nu